Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Dec 8, 2020. It is now read-only.

Commit 4375913

Browse filesBrowse files
authored
Suppress completion in comments (#278)
1 parent fa87d87 commit 4375913
Copy full SHA for 4375913

File tree

1 file changed

+6
-1
lines changed
Filter options

1 file changed

+6
-1
lines changed

‎src/components/completion/completion_manager.ts

Copy file name to clipboardExpand all lines: src/components/completion/completion_manager.ts
+6-1
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,13 @@ export class CompletionManager {
373373
});
374374
}
375375

376-
private completionProvider(document: TextDocument, position: Position): Thenable<CompletionItem[]> {
376+
private completionProvider(document: TextDocument, position: Position): Thenable<CompletionItem[]> | undefined {
377377
const commandArgs = [position.line + 1, position.character, document.fileName, this.tmpFile];
378+
const range = new Range(position.line, 0, position.line, position.character);
379+
const text = document.getText(range).trim();
380+
if (text.startsWith('//')) {
381+
return undefined;
382+
}
378383
return this.runCommand(document, 'complete-with-snippet', commandArgs).then(lines => {
379384
lines.shift();
380385
// Split on MATCH, as a definition can span more than one line

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.