Skip to content

Commit 0d6f652

Browse files
committed
fix: terminal suggestions should hide modal when no completions exist
Signed-off-by: Chapman Pendery <[email protected]>
1 parent 2d58a39 commit 0d6f652

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/vs/workbench/contrib/terminalContrib/suggest/browser/terminalSuggestAddon.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest
452452
}
453453

454454
// Hide and clear model if there are no more items
455-
if ((this._suggestWidget as any)._completionModel?.items.length === 0) {
455+
if (!this._suggestWidget?.hasCompletions()) {
456456
this._additionalInput = undefined;
457457
this.hideSuggestWidget();
458458
// TODO: Don't request every time; refine completions

src/vs/workbench/services/suggest/browser/simpleSuggestWidget.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ export class SimpleSuggestWidget implements IDisposable {
208208
this._completionModel = completionModel;
209209
}
210210

211+
hasCompletions(): boolean {
212+
return this._completionModel?.items.length !== 0;
213+
}
214+
211215
showSuggestions(selectionIndex: number, isFrozen: boolean, isAuto: boolean, cursorPosition: { top: number; left: number; height: number }): void {
212216
this._cursorPosition = cursorPosition;
213217

0 commit comments

Comments
 (0)