@@ -36,6 +36,7 @@ import { IContextKey, IContextKeyService } from '../../../../platform/contextkey
3636import { IExtensionGalleryService , IExtensionManagementService , IGalleryExtension } from '../../../../platform/extensionManagement/common/extensionManagement.js' ;
3737import { IExtensionManifest } from '../../../../platform/extensions/common/extensions.js' ;
3838import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js' ;
39+ import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js' ;
3940import { ILogService } from '../../../../platform/log/common/log.js' ;
4041import { IProductService } from '../../../../platform/product/common/productService.js' ;
4142import { IEditorProgressService , IProgressRunner } from '../../../../platform/progress/common/progress.js' ;
@@ -59,7 +60,7 @@ import { nullRange, Settings2EditorModel } from '../../../services/preferences/c
5960import { IUserDataProfileService } from '../../../services/userDataProfile/common/userDataProfile.js' ;
6061import { IUserDataSyncWorkbenchService } from '../../../services/userDataSync/common/userDataSync.js' ;
6162import { SuggestEnabledInput } from '../../codeEditor/browser/suggestEnabledInput/suggestEnabledInput.js' ;
62- import { CONTEXT_SETTINGS_EDITOR , CONTEXT_SETTINGS_ROW_FOCUS , CONTEXT_SETTINGS_SEARCH_FOCUS , CONTEXT_TOC_ROW_FOCUS , EMBEDDINGS_SEARCH_PROVIDER_NAME , ENABLE_LANGUAGE_FILTER , EXTENSION_FETCH_TIMEOUT_MS , EXTENSION_SETTING_TAG , FEATURE_SETTING_TAG , FILTER_MODEL_SEARCH_PROVIDER_NAME , getExperimentalExtensionToggleData , ID_SETTING_TAG , IPreferencesSearchService , ISearchProvider , LANGUAGE_SETTING_TAG , LLM_RANKED_SEARCH_PROVIDER_NAME , MODIFIED_SETTING_TAG , POLICY_SETTING_TAG , REQUIRE_TRUSTED_WORKSPACE_SETTING_TAG , SETTINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS , SETTINGS_EDITOR_COMMAND_SHOW_AI_RESULTS , SETTINGS_EDITOR_COMMAND_SUGGEST_FILTERS , STRING_MATCH_SEARCH_PROVIDER_NAME , TF_IDF_SEARCH_PROVIDER_NAME , WorkbenchSettingsEditorSettings , WORKSPACE_TRUST_SETTING_TAG } from '../common/preferences.js' ;
63+ import { CONTEXT_AI_SETTING_RESULTS_AVAILABLE , CONTEXT_SETTINGS_EDITOR , CONTEXT_SETTINGS_ROW_FOCUS , CONTEXT_SETTINGS_SEARCH_FOCUS , CONTEXT_TOC_ROW_FOCUS , EMBEDDINGS_SEARCH_PROVIDER_NAME , ENABLE_LANGUAGE_FILTER , EXTENSION_FETCH_TIMEOUT_MS , EXTENSION_SETTING_TAG , FEATURE_SETTING_TAG , FILTER_MODEL_SEARCH_PROVIDER_NAME , getExperimentalExtensionToggleData , ID_SETTING_TAG , IPreferencesSearchService , ISearchProvider , LANGUAGE_SETTING_TAG , LLM_RANKED_SEARCH_PROVIDER_NAME , MODIFIED_SETTING_TAG , POLICY_SETTING_TAG , REQUIRE_TRUSTED_WORKSPACE_SETTING_TAG , SETTINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS , SETTINGS_EDITOR_COMMAND_SHOW_AI_RESULTS , SETTINGS_EDITOR_COMMAND_SUGGEST_FILTERS , SETTINGS_EDITOR_COMMAND_TOGGLE_AI_SEARCH , STRING_MATCH_SEARCH_PROVIDER_NAME , TF_IDF_SEARCH_PROVIDER_NAME , WorkbenchSettingsEditorSettings , WORKSPACE_TRUST_SETTING_TAG } from '../common/preferences.js' ;
6364import { settingsHeaderBorder , settingsSashBorder , settingsTextInputBorder } from '../common/settingsEditorColorRegistry.js' ;
6465import './media/settingsEditor2.css' ;
6566import { preferencesAiResultsIcon , preferencesClearInputIcon , preferencesFilterIcon } from './preferencesIcons.js' ;
@@ -213,6 +214,7 @@ export class SettingsEditor2 extends EditorPane {
213214 private settingRowFocused : IContextKey < boolean > ;
214215 private inSettingsEditorContextKey : IContextKey < boolean > ;
215216 private searchFocusContextKey : IContextKey < boolean > ;
217+ private aiResultsAvailable : IContextKey < boolean > ;
216218
217219 private scheduledRefreshes : Map < string , DisposableStore > ;
218220 private _currentFocusContext : SettingsFocusContext = SettingsFocusContext . Search ;
@@ -262,6 +264,7 @@ export class SettingsEditor2 extends EditorPane {
262264 @IExtensionGalleryService private readonly extensionGalleryService : IExtensionGalleryService ,
263265 @IEditorProgressService private readonly editorProgressService : IEditorProgressService ,
264266 @IUserDataProfileService userDataProfileService : IUserDataProfileService ,
267+ @IKeybindingService private readonly keybindingService : IKeybindingService
265268 ) {
266269 super ( SettingsEditor2 . ID , group , telemetryService , themeService , storageService ) ;
267270 this . searchDelayer = new Delayer ( 200 ) ;
@@ -277,6 +280,7 @@ export class SettingsEditor2 extends EditorPane {
277280 this . searchFocusContextKey = CONTEXT_SETTINGS_SEARCH_FOCUS . bindTo ( contextKeyService ) ;
278281 this . tocRowFocused = CONTEXT_TOC_ROW_FOCUS . bindTo ( contextKeyService ) ;
279282 this . settingRowFocused = CONTEXT_SETTINGS_ROW_FOCUS . bindTo ( contextKeyService ) ;
283+ this . aiResultsAvailable = CONTEXT_AI_SETTING_RESULTS_AVAILABLE . bindTo ( contextKeyService ) ;
280284
281285 this . scheduledRefreshes = new Map < string , DisposableStore > ( ) ;
282286 this . stopWatch = new StopWatch ( false ) ;
@@ -343,6 +347,7 @@ export class SettingsEditor2 extends EditorPane {
343347 if ( this . showAiResultsAction ) {
344348 this . showAiResultsAction . checked = false ;
345349 this . showAiResultsAction . enabled = false ;
350+ this . aiResultsAvailable . set ( false ) ;
346351 this . showAiResultsAction . label = SHOW_AI_RESULTS_DISABLED_LABEL ;
347352 }
348353 }
@@ -758,7 +763,8 @@ export class SettingsEditor2 extends EditorPane {
758763 return this . instantiationService . createInstance ( SettingsSearchFilterDropdownMenuActionViewItem , action , options , this . actionRunner , this . searchWidget ) ;
759764 }
760765 if ( this . showAiResultsAction && action . id === this . showAiResultsAction . id ) {
761- return new ToggleActionViewItem ( null , action , { ...options , keybinding : 'Ctrl+I' , toggleStyles : defaultToggleStyles } ) ;
766+ const keybindingLabel = this . keybindingService . lookupKeybinding ( SETTINGS_EDITOR_COMMAND_TOGGLE_AI_SEARCH ) ?. getLabel ( ) ;
767+ return new ToggleActionViewItem ( null , action , { ...options , keybinding : keybindingLabel , toggleStyles : defaultToggleStyles } ) ;
762768 }
763769 return undefined ;
764770 }
@@ -1833,6 +1839,7 @@ export class SettingsEditor2 extends EditorPane {
18331839 return this . doAiSearch ( query , token ) . then ( ( results ) => {
18341840 if ( results && this . showAiResultsAction ) {
18351841 this . showAiResultsAction . enabled = true ;
1842+ this . aiResultsAvailable . set ( true ) ;
18361843 this . showAiResultsAction . label = SHOW_AI_RESULTS_ENABLED_LABEL ;
18371844 this . renderResultCountMessages ( true ) ;
18381845 }
0 commit comments