don't add inlineCompletionItem to model unless it's supported (#253886)

fix #252367
This commit is contained in:
Megan Rogge
2025-07-03 11:59:17 -04:00
committed by GitHub
parent 0179b5c08a
commit 13eb13b9eb
@@ -342,11 +342,13 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest
}
const lineContext = new LineContext(normalizedLeadingLineContent, this._cursorIndexDelta);
const items = completions.filter(c => !!c.label).map(c => new TerminalCompletionItem(c));
if (isInlineCompletionSupported(this.shellType)) {
items.push(this._inlineCompletionItem);
}
const model = new TerminalCompletionModel(
[
...completions.filter(c => !!c.label).map(c => new TerminalCompletionItem(c)),
this._inlineCompletionItem,
],
items,
lineContext
);
if (token.isCancellationRequested) {