summaryrefslogtreecommitdiffstats
path: root/src/extension.ts
diff options
context:
space:
mode:
authorHO-COOH <42881734+HO-COOH@users.noreply.github.com>2021-04-14 12:50:20 -0500
committerGitHub <noreply@github.com>2021-04-14 19:50:20 +0200
commita9fb66b381f4de6878880adef60b778d5d2fc416 (patch)
tree2b114c0cdc2fdd7323e4aff3cac66e6cbd3d19c2 /src/extension.ts
parentc8c7918538dea9b84499ac73a7d8f430860d9f5a (diff)
downloaddoxdocgen-a9fb66b381f4de6878880adef60b778d5d2fc416.tar.gz
Doxygen command intellisense support (#211)
* Nicer setting descriptions * Initial support for doxygen command completion * Remove commented function * Initial support for doxygen command completion * Remove commented function * Fix multi-line doxygen indentation * Doxygen documentation -> markdown, add gif, update readme
Diffstat (limited to 'src/extension.ts')
-rw-r--r--src/extension.ts18
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!");
+ });
}