summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Schlosser <christoph@linux.com>2018-02-24 10:45:06 +0100
committerChristoph Schlosser <christophschlosser@users.noreply.github.com>2018-02-24 11:30:16 +0100
commitbba53b05a85e4ccad2eca31124ea9d0b80b4e392 (patch)
treedcf394eebdc149169965d8c77998fcd01d6a6f0a
parentbd99c6c5c78d1594ce83e31fdbb3176f49f78821 (diff)
downloaddoxdocgen-bba53b05a85e4ccad2eca31124ea9d0b80b4e392.tar.gz
Customize the number of lines to get
Fix #52
-rw-r--r--package.json5
-rw-r--r--src/Config.ts2
-rw-r--r--src/Lang/Cpp/CppParser.ts2
3 files changed, 8 insertions, 1 deletions
diff --git a/package.json b/package.json
index d70e235..e8000a3 100644
--- a/package.json
+++ b/package.json
@@ -83,6 +83,11 @@
"description": "The template of the return DoxyGen line that is generated. If empty it won't get generated at all.",
"type": "string",
"default": "@return {type} "
+ },
+ "doxdocgen.generic.linesToGet": {
+ "description": "How many lines the plugin should look for to find the end of the declaration. Please be aware that setting this value too low may improve the speed of comment generation but the plugin also may not correctly detect all declarations or definitions anymore.",
+ "type": "number",
+ "default": 20
}
}
}
diff --git a/src/Config.ts b/src/Config.ts
index cce8f72..3a98a71 100644
--- a/src/Config.ts
+++ b/src/Config.ts
@@ -19,6 +19,7 @@ export class Config {
values.paramTemplate = cfg.get<string>("paramTemplate", values.paramTemplate);
values.tparamTemplate = cfg.get<string>("tparamTemplate", values.tparamTemplate);
values.returnTemplate = cfg.get<string>("returnTemplate", values.returnTemplate);
+ values.linesToGet = cfg.get<number>("linesToGet", values.linesToGet);
return values;
}
@@ -39,4 +40,5 @@ export class Config {
public paramTemplate: string = "@param {param} ";
public tparamTemplate: string = "@tparam {param} ";
public returnTemplate: string = "@return {type} ";
+ public linesToGet: number = 20;
}
diff --git a/src/Lang/Cpp/CppParser.ts b/src/Lang/Cpp/CppParser.ts
index 9f8916a..c1a0add 100644
--- a/src/Lang/Cpp/CppParser.ts
+++ b/src/Lang/Cpp/CppParser.ts
@@ -274,7 +274,7 @@ export default class CppParser implements ICodeParser {
logicalLine = nextLineTxt;
// Get method end line
- let linesToGet: number = 20;
+ let linesToGet: number = this.cfg.linesToGet;
while (linesToGet-- > 0) { // Check for end of expression.
nextLine = new Position(nextLine.line + 1, nextLine.character);
nextLineTxt = this.activeEditor.document.lineAt(nextLine.line).text.trim();