From e6779da505893e76d54ea4bf89a10304e55665b7 Mon Sep 17 00:00:00 2001 From: Christoph Schlosser Date: Sat, 14 Oct 2017 14:08:29 +0200 Subject: Add option to generate return type documentation --- src/CodeParser/CParser.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/CodeParser/CParser.ts') 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(Config.generateReturnType, true) && + retVals.length > 0) { + retVals.length = 0; + retVals.push(" "); + return retVals; + } + return retVals; } -- cgit v1.2.3