Merge pull request #243754 from microsoft/tyriar/240891

Remove boolean support for terminal quickSuggestions
This commit is contained in:
Daniel Imms
2025-03-17 07:30:34 -07:00
committed by GitHub
2 changed files with 4 additions and 5 deletions
@@ -261,7 +261,7 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest
this._requestedCompletionsIndex = this._currentPromptInputState.cursorIndex;
const quickSuggestionsConfig = this._configurationService.getValue<ITerminalSuggestConfiguration>(terminalSuggestConfigSection).quickSuggestions;
const allowFallbackCompletions = explicitlyInvoked || quickSuggestionsConfig === true || typeof quickSuggestionsConfig === 'object' && quickSuggestionsConfig.unknown === 'on';
const allowFallbackCompletions = explicitlyInvoked || quickSuggestionsConfig.unknown === 'on';
const providedCompletions = await this._terminalCompletionService.provideCompletions(this._currentPromptInputState.prefix, this._currentPromptInputState.cursorIndex, allowFallbackCompletions, this.shellType, this._capabilities, token, doNotRequestExtensionCompletions);
if (token.isCancellationRequested) {
@@ -413,9 +413,8 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest
if (!this._terminalSuggestWidgetVisibleContextKey.get()) {
const commandLineHasSpace = promptInputState.prefix.trim().match(/\s/);
if (
(typeof config.quickSuggestions === 'boolean' && config.quickSuggestions) ||
(typeof config.quickSuggestions === 'object' && !commandLineHasSpace && config.quickSuggestions.commands !== 'off') ||
(typeof config.quickSuggestions === 'object' && commandLineHasSpace && config.quickSuggestions.arguments !== 'off')
(!commandLineHasSpace && config.quickSuggestions.commands !== 'off') ||
(commandLineHasSpace && config.quickSuggestions.arguments !== 'off')
) {
if (promptInputState.prefix.match(/[^\s]$/)) {
sent = this._requestTriggerCharQuickSuggestCompletions();
@@ -44,7 +44,7 @@ export const terminalSuggestConfigSection = 'terminal.integrated.suggest';
export interface ITerminalSuggestConfiguration {
enabled: boolean;
quickSuggestions: /*Legacy - was this when experimental*/boolean | {
quickSuggestions: {
commands: 'off' | 'on';
arguments: 'off' | 'on';
unknown: 'off' | 'on';