@@ -15,6 +15,7 @@ import { CompletionContext, CompletionItem, CompletionItemKind, CompletionList }
1515import { ITextModel } from 'vs/editor/common/model' ;
1616import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures' ;
1717import { localize } from 'vs/nls' ;
18+ import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
1819import { Registry } from 'vs/platform/registry/common/platform' ;
1920import { inputPlaceholderForeground } from 'vs/platform/theme/common/colorRegistry' ;
2021import { IThemeService } from 'vs/platform/theme/common/themeService' ;
@@ -357,6 +358,7 @@ class VariableCompletions extends Disposable {
357358 @ILanguageFeaturesService private readonly languageFeaturesService : ILanguageFeaturesService ,
358359 @IChatWidgetService private readonly chatWidgetService : IChatWidgetService ,
359360 @IChatVariablesService private readonly chatVariablesService : IChatVariablesService ,
361+ @IConfigurationService private readonly configurationService : IConfigurationService ,
360362 ) {
361363 super ( ) ;
362364
@@ -389,13 +391,14 @@ class VariableCompletions extends Disposable {
389391 . filter ( isResponseVM ) ;
390392
391393 // TODO@roblourens work out a real API for this- maybe it can be part of the two-step flow that @file will probably use
392- const historyItems = history . map ( ( h , i ) : CompletionItem => ( {
394+ const historyVariablesEnabled = this . configurationService . getValue ( 'chat.experimental.historyVariables' ) ;
395+ const historyItems = historyVariablesEnabled ? history . map ( ( h , i ) : CompletionItem => ( {
393396 label : `@response:${ i + 1 } ` ,
394397 detail : h . response . asString ( ) ,
395398 insertText : `@response:${ String ( i + 1 ) . padStart ( String ( history . length ) . length , '0' ) } ` ,
396399 kind : CompletionItemKind . Text ,
397400 range : { insert, replace } ,
398- } ) ) ;
401+ } ) ) : [ ] ;
399402
400403 const variableItems = Array . from ( this . chatVariablesService . getVariables ( ) ) . map ( v => {
401404 const withAt = `@${ v . name } ` ;
0 commit comments