This commit is contained in:
Henning Dieterichs 2023-05-31 15:26:59 +02:00 committed by GitHub
parent 44ef5cc531
commit 1b01ed010e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -114,6 +114,10 @@ export class GhostTextReplacement {
get lineCount(): number {
return this.newLines.length;
}
isEmpty(): boolean {
return this.parts.every(p => p.lines.length === 0);
}
}
export type GhostTextOrReplacement = GhostText | GhostTextReplacement;

View file

@ -33,7 +33,7 @@ export class InlineCompletionContextKeys extends Disposable {
const suggestion = model?.selectedInlineCompletion.read(reader);
const ghostText = model?.ghostText.read(reader);
const selectedSuggestItem = model?.selectedSuggestItem.read(reader);
this.inlineCompletionVisible.set(selectedSuggestItem === undefined && ghostText !== undefined);
this.inlineCompletionVisible.set(selectedSuggestItem === undefined && ghostText !== undefined && !ghostText.isEmpty());
if (ghostText && suggestion) {
this.suppressSuggestions.set(suggestion.inlineCompletion.source.inlineCompletions.suppressSuggestions);