summaryrefslogtreecommitdiffstats
path: root/src/DocGen/CGen.ts
diff options
context:
space:
mode:
authorChristoph Schlosser <christoph@linux.com>2017-10-14 14:08:29 +0200
committerChristoph Schlosser <christophschlosser@users.noreply.github.com>2017-10-14 14:14:57 +0200
commite6779da505893e76d54ea4bf89a10304e55665b7 (patch)
treee1522f2b921a7ed954597df5f6e3d0da0d87f90f /src/DocGen/CGen.ts
parent62c3a6909a01032359742aa66c306743966e7dd2 (diff)
downloaddoxdocgen-e6779da505893e76d54ea4bf89a10304e55665b7.tar.gz
Add option to generate return type documentation
Diffstat (limited to 'src/DocGen/CGen.ts')
-rw-r--r--src/DocGen/CGen.ts14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/DocGen/CGen.ts b/src/DocGen/CGen.ts
index 5a80ee0..426bb26 100644
--- a/src/DocGen/CGen.ts
+++ b/src/DocGen/CGen.ts
@@ -110,13 +110,21 @@ export default class CGen implements IDocGen {
}
protected generateReturn() {
+ if (this.retVals.length === 0) {
+ return;
+ }
let line: string = "";
+ if (this.params.length !== 0) {
+ line = this.lineStart + "\n";
+ this.comment += this.indentLine(line);
+ }
+
this.retVals.forEach((element: string) => {
line = this.lineStart;
line += this.commandIndicator;
line += DoxygenCommands.return + " "; // TODO: Make this customizable
- line += element + "\n";
+ line += element.trim() + "\n";
this.comment += this.indentLine(line);
});
}
@@ -136,10 +144,6 @@ export default class CGen implements IDocGen {
this.generateParams();
}
if (this.retVals.length !== 0) { // Only if we have return values
- if (this.params.length !== 0) {
- const line: string = this.lineStart + "\n";
- this.comment += this.indentLine(line);
- }
this.generateReturn();
}
this.generateEnd();