From bb8524924007367b331a1bac27808f2d9796dc55 Mon Sep 17 00:00:00 2001 From: Rowan Goemans Date: Sun, 15 Oct 2017 03:37:26 +0200 Subject: -- Added defaults to configuration reader in CGen. --- src/DocGen/CGen.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/DocGen/CGen.ts') diff --git a/src/DocGen/CGen.ts b/src/DocGen/CGen.ts index 0b02d09..0f8ce52 100644 --- a/src/DocGen/CGen.ts +++ b/src/DocGen/CGen.ts @@ -67,17 +67,17 @@ export default class CGen implements IDocGen { protected readConfig() { const getCfg = workspace.getConfiguration; - this.firstLine = getCfg(ConfigType.generic).get(Config.firstLine, ""); - this.commentPrefix = getCfg(ConfigType.generic).get(Config.commentPrefix, ""); - this.lastLine = getCfg(ConfigType.generic).get(Config.lastLine, ""); + this.firstLine = getCfg(ConfigType.generic).get(Config.firstLine, "/**"); + this.commentPrefix = getCfg(ConfigType.generic).get(Config.commentPrefix, " * "); + this.lastLine = getCfg(ConfigType.generic).get(Config.lastLine, "**/"); this.newLineAfterBrief = getCfg(ConfigType.generic).get(Config.newLineAfterBrief, true); this.newLineAfterParams = getCfg(ConfigType.generic).get(Config.newLineAfterParams, false); this.newLineAfterTParams = getCfg(ConfigType.generic).get(Config.newLineAfterTParams, false); this.includeTypeAtReturn = getCfg(ConfigType.generic).get(Config.includeTypeAtReturn, false); - this.briefTemplate = getCfg(ConfigType.generic).get(Config.briefTemplate, ""); - this.paramTemplate = getCfg(ConfigType.generic).get(Config.paramTemplate, ""); - this.tparamTemplate = getCfg(ConfigType.generic).get(Config.tparamTemplate, ""); - this.returnTemplate = getCfg(ConfigType.generic).get(Config.returnTemplate, ""); + this.briefTemplate = getCfg(ConfigType.generic).get(Config.briefTemplate, "@brief "); + this.paramTemplate = getCfg(ConfigType.generic).get(Config.paramTemplate, "@param {param} "); + this.tparamTemplate = getCfg(ConfigType.generic).get(Config.tparamTemplate, "@tparam {param} "); + this.returnTemplate = getCfg(ConfigType.generic).get(Config.returnTemplate, "@return {param} "); } protected getIndentation(): string { @@ -169,7 +169,7 @@ export default class CGen implements IDocGen { character = comment.indexOf("\n", oldCharacter + 1) - oldCharacter; } - // If newline is not found means no first param was found so Set to base position. + // If newline is not found means no first param was found so Set to base line before the newline. if (character < 0) { line = baseLine; character = baseCharacter; -- cgit v1.2.3