diff options
| author | Christoph Schlosser <christophschlosser@users.noreply.github.com> | 2020-06-29 21:35:32 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-29 21:35:32 +0200 |
| commit | e689a0085cdd5329611a982f666104cec1477a03 (patch) | |
| tree | 3fa73e64752a60c0ea30dbe7e4533f36ac6f2995 /src/Lang/Cpp | |
| parent | 07c77d40f5a84d7cf2bc1c0e99734d9e3742c0b0 (diff) | |
| download | doxdocgen-e689a0085cdd5329611a982f666104cec1477a03.tar.gz | |
Fix detection of closing comments (#162)
* Fix detection of closing comments
* Add tests
Diffstat (limited to 'src/Lang/Cpp')
| -rw-r--r-- | src/Lang/Cpp/CppParser.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Lang/Cpp/CppParser.ts b/src/Lang/Cpp/CppParser.ts index 708af68..61a4d76 100644 --- a/src/Lang/Cpp/CppParser.ts +++ b/src/Lang/Cpp/CppParser.ts @@ -426,19 +426,19 @@ export default class CppParser implements ICodeParser { if (nextLineTxt.startsWith("#include")) { this.commentType = CommentType.file; return ""; - } else if (nextLineTxt.startsWith("#")) { // preprocessor stuff - this.commentType = CommentType.method; - return "#"; } - if (!this.isVsCodeAutoComplete(nextLineTxt)) { + if (this.isVsCodeAutoComplete(nextLineTxt) === true) { + // Can only be true if it's in the next line + this.vscodeAutoGeneratedComment = linesToGet === (this.cfg.Generic.linesToGet - 1); + } else { logicalLine += "\n"; if (finalSlice >= 0) { logicalLine += nextLineTxt.slice(0, finalSlice); } else { logicalLine += nextLineTxt; } - logicalLine.replace(/\*\//g, ""); + logicalLine = logicalLine.replace(/\*\//g, ""); } if (finalSlice >= 0) { |