diff --git a/package.json b/package.json index e4d4b83fa..3a7c80e4b 100644 --- a/package.json +++ b/package.json @@ -1990,6 +1990,12 @@ "default": false, "markdownDescription": "When `\\` is typed, show unimath symbols in the dropdown selector." }, + "latex-workshop.intellisense.subsuperscript.enabled": { + "scope": "window", + "type": "boolean", + "default": false, + "markdownDescription": "Auto-complete sub- and super-scripts from the current project." + }, "latex-workshop.intellisense.package.enabled": { "scope": "window", "type": "boolean", diff --git a/src/completion/completer/subsuperscript.ts b/src/completion/completer/subsuperscript.ts index f9f6b2fdc..eb77f2344 100644 --- a/src/completion/completer/subsuperscript.ts +++ b/src/completion/completer/subsuperscript.ts @@ -10,7 +10,10 @@ export const subsuperscript = { parse, } -function from(result: RegExpMatchArray, _: CompletionArgs) { +function from(result: RegExpMatchArray, _: CompletionArgs): CompletionItem[] { + if (false === vscode.workspace.getConfiguration('latex-workshop').get('intellisense.subsuperscript.enabled') as boolean) { + return [] + } const isSub = result[0].startsWith('_') let suggestions: CompletionItem[] = [] lw.cache.getIncludedTeX().forEach(cachedFile => {