diff options
Diffstat (limited to 'src/CodeParserController.ts')
| -rw-r--r-- | src/CodeParserController.ts | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/CodeParserController.ts b/src/CodeParserController.ts index f87e221..3b6348a 100644 --- a/src/CodeParserController.ts +++ b/src/CodeParserController.ts @@ -12,6 +12,7 @@ import CodeParser from "./Common/ICodeParser"; import { Config } from "./Config"; import GitConfig from "./GitConfig"; import CppParser from "./Lang/Cpp/CppParser"; +import { inComment } from "./util"; /** * * Checks if the event matches the specified guidelines and if a parser exists for this language @@ -75,7 +76,7 @@ export default class CodeParserController { } // Check if currently in a comment block - if (this.inComment(activeEditor, activeSelection.line)) { + if (inComment(activeEditor, activeSelection.line)) { return false; } @@ -92,20 +93,6 @@ export default class CodeParserController { } } - private inComment(activeEditor: TextEditor, activeLine: number): boolean { - if (activeLine === 0) { - return false; - } - - const txt: string = activeEditor.document.lineAt(activeLine - 1).text.trim(); - if (!txt.startsWith("///") && !txt.startsWith("*") && - !txt.startsWith("/**") && !txt.startsWith("/*!")) { - return false; - } else { - return true; - } - } - private onEvent(activeEditor: TextEditor, event: TextDocumentContentChangeEvent) { if (!this.check(activeEditor, event)) { return null; |