From 8b29e605b76bf0f79685be511e60ff0d64a2375d Mon Sep 17 00:00:00 2001 From: to-s Date: Sat, 10 Oct 2020 14:53:58 -0400 Subject: Added file description in first line (#183) * Added file description in first line Due to https://github.com/cschlosser/doxdocgen/issues/141 * Added addIndent flag to SetLines() Co-authored-by: Christoph Schlosser <2466365+cschlosser@users.noreply.github.com> --- src/Lang/Cpp/CppParser.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/Lang/Cpp/CppParser.ts') diff --git a/src/Lang/Cpp/CppParser.ts b/src/Lang/Cpp/CppParser.ts index 8ed4bc8..3aad6ed 100644 --- a/src/Lang/Cpp/CppParser.ts +++ b/src/Lang/Cpp/CppParser.ts @@ -428,6 +428,15 @@ export default class CppParser implements ICodeParser { return ""; } else if (nextLineTxt.startsWith("#") && ! nextLineTxt.startsWith("#define")) { return ""; + } else if (nextLine.line === 2) { // Check if there where two empty lines trailing the file + if (this.activeEditor.document.lineAt(0).text === this.cfg.C.firstLine + && ( + this.activeEditor.document.lineAt(1).text === this.cfg.C.commentPrefix + || this.activeEditor.document.lineAt(1).text.trim() === "" + ) && this.activeEditor.document.lineAt(2).text.trim() === "") { + this.commentType = CommentType.file; + return ""; + } } if (this.isVsCodeAutoComplete(nextLineTxt) === true) { -- cgit v1.2.3