@@ -15,6 +15,7 @@ import { CompletionContext, CompletionItem, CompletionItemKind, CompletionList }
15
15
import { ITextModel } from 'vs/editor/common/model' ;
16
16
import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures' ;
17
17
import { localize } from 'vs/nls' ;
18
+ import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
18
19
import { Registry } from 'vs/platform/registry/common/platform' ;
19
20
import { inputPlaceholderForeground } from 'vs/platform/theme/common/colorRegistry' ;
20
21
import { IThemeService } from 'vs/platform/theme/common/themeService' ;
@@ -357,6 +358,7 @@ class VariableCompletions extends Disposable {
357
358
@ILanguageFeaturesService private readonly languageFeaturesService : ILanguageFeaturesService ,
358
359
@IChatWidgetService private readonly chatWidgetService : IChatWidgetService ,
359
360
@IChatVariablesService private readonly chatVariablesService : IChatVariablesService ,
361
+ @IConfigurationService private readonly configurationService : IConfigurationService ,
360
362
) {
361
363
super ( ) ;
362
364
@@ -389,13 +391,14 @@ class VariableCompletions extends Disposable {
389
391
. filter ( isResponseVM ) ;
390
392
391
393
// 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 => ( {
393
396
label : `@response:${ i + 1 } ` ,
394
397
detail : h . response . asString ( ) ,
395
398
insertText : `@response:${ String ( i + 1 ) . padStart ( String ( history . length ) . length , '0' ) } ` ,
396
399
kind : CompletionItemKind . Text ,
397
400
range : { insert, replace } ,
398
- } ) ) ;
401
+ } ) ) : [ ] ;
399
402
400
403
const variableItems = Array . from ( this . chatVariablesService . getVariables ( ) ) . map ( v => {
401
404
const withAt = `@${ v . name } ` ;
0 commit comments