File tree Expand file tree Collapse file tree
src/vs/workbench/contrib/preferences/browser Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -292,7 +292,9 @@ export class SettingsEditor2 extends EditorPane {
292292 . split ( this . DISMISSED_EXTENSION_SETTINGS_DELIMITER ) ;
293293
294294 this . _register ( configurationService . onDidChangeConfiguration ( e => {
295- if ( e . affectedKeys . has ( WorkbenchSettingsEditorSettings . ShowAISearchToggle ) || e . affectedKeys . has ( WorkbenchSettingsEditorSettings . EnableNaturalLanguageSearch ) ) {
295+ if ( e . affectedKeys . has ( WorkbenchSettingsEditorSettings . ShowAISearchToggle )
296+ || e . affectedKeys . has ( WorkbenchSettingsEditorSettings . EnableNaturalLanguageSearch )
297+ || e . affectedKeys . has ( 'chat.disableAIFeatures' ) ) {
296298 this . updateAiSearchToggleVisibility ( ) ;
297299 }
298300 if ( e . source !== ConfigurationTarget . DEFAULT ) {
@@ -360,7 +362,8 @@ export class SettingsEditor2 extends EditorPane {
360362 const showAiToggle = this . configurationService . getValue < boolean > ( WorkbenchSettingsEditorSettings . ShowAISearchToggle ) ;
361363 const enableNaturalLanguageSearch = this . configurationService . getValue < boolean > ( WorkbenchSettingsEditorSettings . EnableNaturalLanguageSearch ) ;
362364 const chatSetupHidden = this . contextKeyService . getContextKeyValue < boolean > ( 'chatSetupHidden' ) ;
363- const canShowToggle = showAiToggle && enableNaturalLanguageSearch && ! chatSetupHidden ;
365+ const chatFeaturesDisabled = this . configurationService . getValue < boolean > ( 'chat.disableAIFeatures' ) ;
366+ const canShowToggle = showAiToggle && enableNaturalLanguageSearch && ! chatSetupHidden && ! chatFeaturesDisabled ;
364367
365368 const alreadyVisible = this . searchInputActionBar . hasAction ( this . showAiResultsAction ) ;
366369 if ( ! alreadyVisible && canShowToggle ) {
You can’t perform that action at this time.
0 commit comments