-
Notifications
You must be signed in to change notification settings - Fork 37.1k
Update terminal suggest status bar #285060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates the terminal suggest status bar to add new actions for controlling IntelliSense behavior and adds icon support to the suggest widget status bar. The changes include refactoring the configuration schema to support boolean values for quickSuggestions, changing default values for suggest settings, and adding new menu actions with icons.
Key Changes
- Added icon support to
SuggestWidgetStatusthrough a newISuggestWidgetStatusOptionsinterface - Changed
quickSuggestionsconfiguration to accept boolean or object values, with a new normalization function - Changed configuration defaults:
quickSuggestionsfrom object tofalse,suggestOnTriggerCharactersfromtruetofalse - Reorganized terminal suggest status bar menu with new actions for toggling selection modes and IntelliSense visibility
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
suggestWidgetStatus.ts |
Added ISuggestWidgetStatusOptions interface and updated constructor to support icon display via allowIcons option |
simpleSuggestWidget.ts |
Updated two instances of SuggestWidgetStatus instantiation to pass { allowIcons: true } option |
suggestWidget.ts |
Updated SuggestWidgetStatus instantiation to pass { allowIcons: true } option |
terminalSuggestConfiguration.ts |
Changed quickSuggestions type to accept boolean or object, added normalizeQuickSuggestionsConfig function, changed defaults for quickSuggestions and suggestOnTriggerCharacters to false |
terminal.suggest.ts |
Added six new command IDs for selection mode changes and show/hide IntelliSense actions |
terminalSuggestAddon.ts |
Updated to use normalizeQuickSuggestionsConfig when reading quickSuggestions configuration |
terminal.suggest.contribution.ts |
Refactored status bar actions: added three selection mode toggle actions, two show/hide IntelliSense actions with icons, reorganized existing actions into right group with icons, removed menu entry from AcceptSelectedSuggestion action |
| icon: Codicon.eye, | ||
| menu: { | ||
| id: MenuId.MenubarTerminalSuggestStatusMenu, | ||
| group: 'right', | ||
| order: 1 | ||
| order: 1, | ||
| when: ContextKeyExpr.and( | ||
| ContextKeyExpr.equals(`config.${TerminalSuggestSettingId.QuickSuggestions}`, true), | ||
| ContextKeyExpr.equals(`config.${TerminalSuggestSettingId.SuggestOnTriggerCharacters}`, true), | ||
| ), | ||
| }, | ||
| run: (c, accessor) => accessor.get(IPreferencesService).openSettings({ query: terminalSuggestConfigSection }) | ||
| run: (c, accessor) => { | ||
| accessor.get(IConfigurationService).updateValue(TerminalSuggestSettingId.QuickSuggestions, false); | ||
| accessor.get(IConfigurationService).updateValue(TerminalSuggestSettingId.SuggestOnTriggerCharacters, false); | ||
| } | ||
| }); | ||
|
|
||
| registerTerminalAction({ | ||
| id: TerminalSuggestCommandId.ShowOnType, | ||
| title: localize2('workbench.action.terminal.showSuggestOnType', 'Show IntelliSense while typing'), | ||
| f1: false, | ||
| precondition: ContextKeyExpr.and(ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated), TerminalContextKeys.focus, TerminalContextKeys.isOpen, TerminalContextKeys.suggestWidgetVisible), | ||
| icon: Codicon.eyeClosed, |
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The icon usage appears reversed. 'DoNotShowOnType' uses 'Codicon.eye' (typically meaning 'visible/show'), while 'ShowOnType' uses 'Codicon.eyeClosed' (typically meaning 'hidden/hide'). The icons should be swapped to match their semantic meaning.
| }, | ||
| } | ||
| ], | ||
| default: false, |
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value for quickSuggestions changed from an object to false, which is a breaking change that will disable IntelliSense for existing users who haven't explicitly configured this setting. This may negatively impact the user experience. Consider migrating existing configurations or documenting this as a breaking change.
| default: false, | |
| default: { | |
| commands: 'on', | |
| arguments: 'on', | |
| unknown: 'on' | |
| }, |
| }, | ||
| [TerminalSuggestSettingId.SuggestOnTriggerCharacters]: { | ||
| restricted: true, | ||
| markdownDescription: localize('suggest.suggestOnTriggerCharacters', "Controls whether suggestions should automatically show up when typing trigger characters."), |
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value for suggestOnTriggerCharacters changed from true to false, which is a breaking change that will disable trigger character suggestions for existing users. This change should be documented or consider providing a migration path for existing users.
| markdownDescription: localize('suggest.suggestOnTriggerCharacters', "Controls whether suggestions should automatically show up when typing trigger characters."), | |
| markdownDescription: localize('suggest.suggestOnTriggerCharacters', "Controls whether suggestions should automatically show up when typing trigger characters. This is disabled by default; set this to `true` to restore trigger character suggestions if they were previously enabled."), |
| order: 1 | ||
| order: 1, | ||
| when: ContextKeyExpr.and( | ||
| ContextKeyExpr.equals(`config.${TerminalSuggestSettingId.QuickSuggestions}`, true), |
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The menu condition checks if quickSuggestions equals true, but quickSuggestions can be either a boolean or an object. When it's an object like {commands: 'on', arguments: 'on', unknown: 'off'}, this condition will fail even though IntelliSense is enabled. The condition should handle both boolean and object values, or the menu logic needs to be updated to work with the normalized config value.
| ContextKeyExpr.equals(`config.${TerminalSuggestSettingId.QuickSuggestions}`, true), | |
| ContextKeyExpr.notEquals(`config.${TerminalSuggestSettingId.QuickSuggestions}`, false), |
| ContextKeyExpr.notEquals(`config.${TerminalSuggestSettingId.QuickSuggestions}`, true), | ||
| ContextKeyExpr.notEquals(`config.${TerminalSuggestSettingId.SuggestOnTriggerCharacters}`, true), |
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the DoNotShowOnType action, this menu condition uses notEquals to check for true, which won't work correctly when quickSuggestions is an object. This will cause the ShowOnType action to appear even when IntelliSense is enabled via object configuration.
| ContextKeyExpr.notEquals(`config.${TerminalSuggestSettingId.QuickSuggestions}`, true), | |
| ContextKeyExpr.notEquals(`config.${TerminalSuggestSettingId.SuggestOnTriggerCharacters}`, true), | |
| ContextKeyExpr.equals(`config.${TerminalSuggestSettingId.QuickSuggestions}`, false), | |
| ContextKeyExpr.equals(`config.${TerminalSuggestSettingId.SuggestOnTriggerCharacters}`, false), |
| id: TerminalSuggestCommandId.ConfigureSettings, | ||
| title: localize2('workbench.action.terminal.configureSuggestSettings', 'Configure'), | ||
| id: TerminalSuggestCommandId.ChangeSelectionModeNever, | ||
| title: localize2('workbench.action.terminal.changeSelectionMode.never', 'Change Keybinding: None'), |
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The action title 'Change Keybinding: None' is misleading. This action is visible when the selection mode is 'never', but clicking it sets the mode to 'partial'. The title should reflect what the action does (e.g., 'Use Tab to Accept Suggestions') rather than describing the current state.
| title: localize2('workbench.action.terminal.changeSelectionMode.never', 'Change Keybinding: None'), | |
| title: localize2('workbench.action.terminal.changeSelectionMode.never', "Use Tab to Accept Suggestions"), |
| }); | ||
| registerTerminalAction({ | ||
| id: TerminalSuggestCommandId.ChangeSelectionModePartial, | ||
| title: localize2('workbench.action.terminal.changeSelectionMode.partial', 'Change Keybinding: Tab'), |
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the previous action, this title describes the current state ('Change Keybinding: Tab') but the action sets the mode to 'always'. The title should describe what will happen when clicked (e.g., 'Use Tab + Enter to Accept Suggestions').
| title: localize2('workbench.action.terminal.changeSelectionMode.partial', 'Change Keybinding: Tab'), | |
| title: localize2('workbench.action.terminal.changeSelectionMode.partial', 'Use Tab and Enter to Accept Suggestions'), |
| }); | ||
| registerTerminalAction({ | ||
| id: TerminalSuggestCommandId.ChangeSelectionModeAlways, | ||
| title: localize2('workbench.action.terminal.changeSelectionMode.always', 'Change Keybinding: Tab + Enter'), |
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This title describes the current state ('Change Keybinding: Tab + Enter') but the action sets the mode to 'never'. The title should describe what will happen when clicked (e.g., 'Disable Tab/Enter for Accepting Suggestions').
| title: localize2('workbench.action.terminal.changeSelectionMode.always', 'Change Keybinding: Tab + Enter'), | |
| title: localize2('workbench.action.terminal.changeSelectionMode.always', 'Disable Tab/Enter For Accepting Suggestions'), |
Part of #284277