diff options
| author | Christoph Schlosser <christoph@linux.com> | 2017-10-09 21:15:00 +0200 |
|---|---|---|
| committer | Christoph Schlosser <christophschlosser@users.noreply.github.com> | 2017-10-09 21:48:19 +0200 |
| commit | f1f1b62073a36df8e2e2f08fd343ebdaab77ed82 (patch) | |
| tree | 53fddac46fefa91e46b50b4863fbaff7d82a8251 /src | |
| parent | 922d75bcc24f16f817d8ab3f11d43a4edffb1f9f (diff) | |
| download | doxdocgen-0.0.3.tar.gz | |
Add option to choose Qt style comment start0.0.3
Diffstat (limited to 'src')
| -rw-r--r-- | src/CodeParser/CodeParserController.ts | 8 | ||||
| -rw-r--r-- | src/Config.ts | 7 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/CodeParser/CodeParserController.ts b/src/CodeParser/CodeParserController.ts index 7ed113e..49d4082 100644 --- a/src/CodeParser/CodeParserController.ts +++ b/src/CodeParser/CodeParserController.ts @@ -1,4 +1,5 @@ import { Disposable, Position, TextDocumentContentChangeEvent, TextEditor, TextLine, window, workspace } from "vscode"; +import { Config, ConfigType } from "../Config"; import CodeParser from "./CodeParser"; import CParser from "./CParser"; import CppParser from "./CppParser"; @@ -22,12 +23,12 @@ export default class CodeParserController { public constructor() { const subscriptions: Disposable[] = []; - this.readConfig(); - // Hand off the event to the parser if a valid parser is found workspace.onDidChangeTextDocument((event) => { const activeEditor: TextEditor = window.activeTextEditor; if (activeEditor && event.document === activeEditor.document) { + this.readConfig(); + this.onEvent(activeEditor, event.contentChanges[0]); } }, this, subscriptions); @@ -50,7 +51,8 @@ export default class CodeParserController { ***************************************************************************/ private readConfig() { - this.indicators.push("/**"); // TODO: make this customizable + this.indicators.pop(); + this.indicators.push(workspace.getConfiguration(ConfigType.generic).get<string>(Config.commentStart, "/**")); } private check(activeEditor: TextEditor, event: TextDocumentContentChangeEvent): boolean { diff --git a/src/Config.ts b/src/Config.ts new file mode 100644 index 0000000..92d208c --- /dev/null +++ b/src/Config.ts @@ -0,0 +1,7 @@ +export enum ConfigType { + generic = "doxdocgen.generic", +} + +export enum Config { + commentStart = "commentStart", +} |