diff options
| author | Christoph Schlosser <christoph@linux.com> | 2017-10-14 14:08:29 +0200 |
|---|---|---|
| committer | Christoph Schlosser <christophschlosser@users.noreply.github.com> | 2017-10-14 14:14:57 +0200 |
| commit | e6779da505893e76d54ea4bf89a10304e55665b7 (patch) | |
| tree | e1522f2b921a7ed954597df5f6e3d0da0d87f90f /src/CodeParser | |
| parent | 62c3a6909a01032359742aa66c306743966e7dd2 (diff) | |
| download | doxdocgen-e6779da505893e76d54ea4bf89a10304e55665b7.tar.gz | |
Add option to generate return type documentation
Diffstat (limited to 'src/CodeParser')
| -rw-r--r-- | src/CodeParser/CParser.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/CodeParser/CParser.ts b/src/CodeParser/CParser.ts index 99d01fc..4889de6 100644 --- a/src/CodeParser/CParser.ts +++ b/src/CodeParser/CParser.ts @@ -1,4 +1,5 @@ -import { Position, TextDocumentContentChangeEvent, TextEditor, TextLine } from "vscode"; +import { Position, TextDocumentContentChangeEvent, TextEditor, TextLine, workspace } from "vscode"; +import { Config, ConfigType } from "../Config"; import Generator from "../DocGen/CGen"; import { IDocGen } from "../DocGen/DocGen"; import ICodeParser from "./CodeParser"; @@ -105,6 +106,14 @@ export default class CParser implements ICodeParser { break; } + // Don't generate return type if the user doesn't wish to do it + if (!workspace.getConfiguration(ConfigType.generic).get<boolean>(Config.generateReturnType, true) && + retVals.length > 0) { + retVals.length = 0; + retVals.push(" "); + return retVals; + } + return retVals; } |