diff options
| author | Christoph Schlosser <christoph@linux.com> | 2018-10-20 15:19:30 +0200 |
|---|---|---|
| committer | Christoph Schlosser <christoph@linux.com> | 2018-10-20 15:19:30 +0200 |
| commit | df3a5391f49dd3947354963dcf8a23e7ceec2b41 (patch) | |
| tree | d229bea00a1e9d00da4684c9b29bfb2fdc47f285 | |
| parent | 577687906fa80a4ddbad7ed57845a751b4dbacc3 (diff) | |
| download | doxdocgen-df3a5391f49dd3947354963dcf8a23e7ceec2b41.tar.gz | |
Parse python with #
| -rw-r--r-- | package.json | 2 | ||||
| -rw-r--r-- | src/CodeParserController.ts | 7 | ||||
| -rw-r--r-- | src/Config.ts | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/package.json b/package.json index cfa7e68..9229e4f 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "doxdocgen.python.triggerSequence": { "description": "Doxygen comment trigger. This character sequence triggers generation of Doxygen comments.", "type": "string", - "default": "\"\"\"" + "default": "##" }, "doxdocgen.file.fileTemplate": { "description": "The template for the file parameter in Doxygen.", diff --git a/src/CodeParserController.ts b/src/CodeParserController.ts index 1dfc5c4..4e38f06 100644 --- a/src/CodeParserController.ts +++ b/src/CodeParserController.ts @@ -80,12 +80,15 @@ export default class CodeParserController { // Do not trigger when there's whitespace after the trigger sequence // tslint:disable-next-line:max-line-length - const seq = "[\\s]*(" + this.cfg.C.triggerSequence.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&") + ")$"; + const seq = "[\\s]*([" + this.cfg.C.triggerSequence.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&") + "]|[" + this.cfg.Python.triggerSequence.replace(/\#/g, "\\$&") + "])$"; const match: RegExpMatchArray = activeLine.text.match(seq); if (match !== null) { const cont: string = match[1]; - return this.cfg.C.triggerSequence === cont; + return ( + this.cfg.C.triggerSequence === cont || + cont === "#" // probably python + ); } else { return false; } diff --git a/src/Config.ts b/src/Config.ts index 55a22b5..58f3a43 100644 --- a/src/Config.ts +++ b/src/Config.ts @@ -31,7 +31,7 @@ class Python { return workspace.getConfiguration("doxdocgen.python"); } - public triggerSequence: string = '"""'; + public triggerSequence: string = "##"; } class File { |