Skip to content

Commit

Permalink
respond to config change for terminal suggestions (microsoft#235999)
Browse files Browse the repository at this point in the history
* fix microsoft#235071

* tweak

* fixes microsoft#235996

* tweak
  • Loading branch information
meganrogge authored Dec 13, 2024
1 parent b911e7c commit db62636
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,24 @@ class TerminalSuggestContribution extends DisposableStore implements ITerminalCo
this._pwshAddon?.dispose();
}));
this._terminalSuggestWidgetVisibleContextKey = TerminalContextKeys.suggestWidgetVisible.bindTo(this._contextKeyService);
this.add(this._configurationService.onDidChangeConfiguration(e => {
if (e.affectsConfiguration(TerminalSuggestSettingId.EnableExtensionCompletions) || e.affectsConfiguration(TerminalSuggestSettingId.Enabled)) {
const extensionCompletionsEnabled = this._configurationService.getValue<ITerminalSuggestConfiguration>(terminalSuggestConfigSection).enableExtensionCompletions;
const completionsEnabled = this._configurationService.getValue<ITerminalSuggestConfiguration>(terminalSuggestConfigSection).enabled;
if (!extensionCompletionsEnabled || !completionsEnabled) {
this._addon.clear();
}
if (!completionsEnabled) {
this._pwshAddon.clear();
}
const xtermRaw = this._ctx.instance.xterm?.raw;
if (!!xtermRaw && extensionCompletionsEnabled || completionsEnabled) {
if (xtermRaw) {
this._loadAddons(xtermRaw);
}
}
}
}));
}

xtermOpen(xterm: IXtermTerminal & { raw: RawXtermTerminal }): void {
Expand Down

0 comments on commit db62636

Please sign in to comment.