Skip to content

Commit 046fb7a

Browse files
committed
fix: return empty line completition, avoid completition when system autocomplete shown
1 parent 6dbc4d5 commit 046fb7a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/prompts/filter.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@ export function isSupported(doc: vscode.TextDocument) {
44
return doc.uri.scheme === 'file';
55
}
66

7-
export function isNotNeeded(doc: vscode.TextDocument, position: vscode.Position): boolean {
7+
export function isNotNeeded(doc: vscode.TextDocument, position: vscode.Position, context: vscode.InlineCompletionContext): boolean {
88

99
// Avoid autocomplete on empty lines
10-
const line = doc.lineAt(position.line).text.trim();
11-
if (line.trim() === '') {
10+
// const line = doc.lineAt(position.line).text.trim();
11+
// if (line.trim() === '') {
12+
// return true;
13+
// }
14+
15+
// Avoid autocomplete when system menu is shown (ghost text is hidden anyway)
16+
if (context.selectedCompletionInfo) {
1217
return true;
1318
}
1419

0 commit comments

Comments
 (0)