diff options
Diffstat (limited to 'src/extension.ts')
| -rw-r--r-- | src/extension.ts | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/extension.ts b/src/extension.ts index 3329ee4..b7c148c 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -3,6 +3,7 @@ // Import the module and reference it with the alias vscode in your code below import * as vscode from "vscode"; import CodeParserController from "./CodeParserController"; +import DoxygenCompletionItemProvider from "./DoxygenCompletionItemProvider"; enum Version { CURRENT = "1.1.0", @@ -12,7 +13,9 @@ enum Version { // this method is called when your extension is activated // your extension is activated the very first time the command is executed -export function activate(context: vscode.ExtensionContext) { +export function activate(context: vscode.ExtensionContext) +{ + const parser = new CodeParserController(); context.subscriptions.push(parser); @@ -23,4 +26,17 @@ export function activate(context: vscode.ExtensionContext) { } else if (version !== Version.CURRENT) { context.globalState.update(Version.KEY, Version.CURRENT); } + + /*register doxygen commands intellisense */ + if (vscode.workspace.getConfiguration("doxdocgen.generic").get<boolean>("commandSuggestion")) + vscode.languages.registerCompletionItemProvider({ language: "cpp", scheme: "file" }, new DoxygenCompletionItemProvider(), "@", "\\"); + + //After the CompletionItemProvider is registered, it cannot be unregistered + //Check the settings everytime when it is triggered would be inefficient + //So just prompt the user to restart to take effect + vscode.workspace.onDidChangeConfiguration(event => + { + if (event.affectsConfiguration("doxdocgen.generic.commandSuggestion")) + vscode.window.showWarningMessage("Please restart vscode to apply the changes!"); + }); } |