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 | |
| parent | 922d75bcc24f16f817d8ab3f11d43a4edffb1f9f (diff) | |
| download | doxdocgen-f1f1b62073a36df8e2e2f08fd343ebdaab77ed82.tar.gz | |
Add option to choose Qt style comment start0.0.3
| -rw-r--r-- | CHANGELOG.md | 4 | ||||
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | package.json | 19 | ||||
| -rw-r--r-- | src/CodeParser/CodeParserController.ts | 8 | ||||
| -rw-r--r-- | src/Config.ts | 7 |
5 files changed, 35 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d661d3..29e872e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## [0.0.3] + +- Add possibility to set comment start indicator to Qt style + ## [0.0.2] - Add C parser and generator @@ -52,6 +52,7 @@ Completely new extension, so none. * Suggest smart text * Configuration options + * Support more configuration options * Tests diff --git a/package.json b/package.json index 66e256c..a5d6658 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "doxdocgen", "displayName": "Doxygen Documentation Generator", "description": "Generate doxygen documentation from source code", - "version": "0.0.2", + "version": "0.0.3", "publisher": "cschlosser", "engines": { "vscode": "^1.16.0" @@ -13,6 +13,23 @@ "activationEvents": [ "onLanguage:cpp" ], + "contributes": { + "configuration": { + "type": "object", + "title": "Doxygen Documentation Generator Settings", + "properties": { + "doxdocgen.generic.commentStart": { + "description": "Doxygen comment start indicator. Default ist /** but Qt style with /*! is also valid.", + "type": "string", + "default": "/**", + "enum": [ + "/**", + "/*!" + ] + } + } + } + }, "icon": "images/icon.png", "keywords": [ "cpp", "c++", "c", "doxygen" 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", +} |