diff options
| author | Christoph Schlosser <christoph@linux.com> | 2019-06-22 14:11:12 +0200 |
|---|---|---|
| committer | Christoph Schlosser <christophschlosser@users.noreply.github.com> | 2019-06-22 15:30:39 +0200 |
| commit | c66cc5c25d8824ade69b91129a842666bf0cf13f (patch) | |
| tree | 22f137e8914a1ddda69cac30532f3404e7a23c83 /src/Lang/Cpp/CppParser.ts | |
| parent | cabf19e4caa35ae010b1bab19d48ad749a959e06 (diff) | |
| download | doxdocgen-c66cc5c25d8824ade69b91129a842666bf0cf13f.tar.gz | |
Fix autogenerated close comment
Diffstat (limited to 'src/Lang/Cpp/CppParser.ts')
| -rw-r--r-- | src/Lang/Cpp/CppParser.ts | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/Lang/Cpp/CppParser.ts b/src/Lang/Cpp/CppParser.ts index 37c36eb..ca5edbb 100644 --- a/src/Lang/Cpp/CppParser.ts +++ b/src/Lang/Cpp/CppParser.ts @@ -111,6 +111,8 @@ export default class CppParser implements ICodeParser { private casingType: CasingType; + private vscodeAutoGeneratedComment: boolean; + constructor(cfg: Config) { this.cfg = cfg; @@ -301,6 +303,7 @@ export default class CppParser implements ICodeParser { this.specialCase = SpecialCase.none; this.commentType = CommentType.method; + this.vscodeAutoGeneratedComment = false; } /** @@ -369,6 +372,7 @@ export default class CppParser implements ICodeParser { this.specialCase, this.commentType, this.casingType, + this.vscodeAutoGeneratedComment, ); } @@ -421,7 +425,9 @@ export default class CppParser implements ICodeParser { return ""; } - logicalLine += "\n" + nextLineTxt; + if (!this.isVsCodeAutoComplete(nextLineTxt)) { + logicalLine += "\n" + nextLineTxt; + } } throw new Error("More than " + linesToGet + " lines were read from editor and no end of expression was found."); @@ -799,4 +805,14 @@ export default class CppParser implements ICodeParser { return args; } + + private isVsCodeAutoComplete(line: string): boolean { + switch (line) { + case "*/": + this.vscodeAutoGeneratedComment = true; + return true; + default: + return false; + } + } } |