Skip to content

Commit 07fc574

Browse files
committed
Stops completionProvider triggering in comments #56
1 parent 3bbca5c commit 07fc574

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/ai_completion.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,13 @@ const provideCompletionItems = (document, position) => {
175175
range = new Range(position, position);
176176
}
177177

178+
// Remove completion offerings from commented lines
179+
const line = document.lineAt(position.line);
180+
const firstChar = line.text.charAt(line.firstNonWhitespaceCharacterIndex);
181+
if (firstChar === ';') {
182+
return null;
183+
}
184+
178185
const variableCompletions = getVariableCompletions(text, prefix);
179186
const functionCompletions = getLocalFunctionCompletions(text);
180187

0 commit comments

Comments
 (0)