summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Schlosser <christoph@linux.com>2019-10-05 12:33:36 +0200
committerChristoph Schlosser <christophschlosser@users.noreply.github.com>2019-10-05 14:59:29 +0200
commit4ab08d85d42d00fe689d0119eed269ed98b226c8 (patch)
treee4ec5330e0c85d44e0ed590d1e47ae613b156327
parentc5d67b22db9185f155df3cefba06df6916c1eb90 (diff)
downloaddoxdocgen-4ab08d85d42d00fe689d0119eed269ed98b226c8.tar.gz
Fix vscodeautocomplete detection
-rw-r--r--src/Lang/Cpp/CppParser.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Lang/Cpp/CppParser.ts b/src/Lang/Cpp/CppParser.ts
index ca5edbb..35066fe 100644
--- a/src/Lang/Cpp/CppParser.ts
+++ b/src/Lang/Cpp/CppParser.ts
@@ -409,13 +409,13 @@ export default class CppParser implements ICodeParser {
currentNest--;
} else if (nextLineTxt[i] === "{" && currentNest === 0) {
logicalLine += "\n" + nextLineTxt.slice(0, i);
- return logicalLine.replace(/^\s+|\s+$/g, "");
+ break;
} else if ((nextLineTxt[i] === ";"
|| (nextLineTxt[i] === ":" && nextLineTxt[i - 1] !== ":" && nextLineTxt[i + 1] !== ":"))
&& currentNest === 0) {
logicalLine += "\n" + nextLineTxt.slice(0, i);
- return logicalLine.replace(/^\s+|\s+$/g, "");
+ break;
}
}
@@ -425,9 +425,12 @@ export default class CppParser implements ICodeParser {
return "";
}
- if (!this.isVsCodeAutoComplete(nextLineTxt)) {
+ if (this.isVsCodeAutoComplete(nextLineTxt)) {
logicalLine += "\n" + nextLineTxt;
+ logicalLine.replace(/\*\//g, "");
}
+
+ return logicalLine.trim();
}
throw new Error("More than " + linesToGet + " lines were read from editor and no end of expression was found.");