@@ -7,18 +7,20 @@ import { MarkdownString } from '../../../../../base/common/htmlContent.js';
7
7
import { Disposable , MutableDisposable , toDisposable } from '../../../../../base/common/lifecycle.js' ;
8
8
import { autorun } from '../../../../../base/common/observable.js' ;
9
9
import { themeColorFromId } from '../../../../../base/common/themables.js' ;
10
+ import { URI } from '../../../../../base/common/uri.js' ;
10
11
import { ICodeEditorService } from '../../../../../editor/browser/services/codeEditorService.js' ;
11
12
import { Range } from '../../../../../editor/common/core/range.js' ;
12
13
import { IDecorationOptions } from '../../../../../editor/common/editorCommon.js' ;
13
14
import { TrackedRangeStickiness } from '../../../../../editor/common/model.js' ;
14
15
import { localize } from '../../../../../nls.js' ;
15
16
import { IConfigurationService } from '../../../../../platform/configuration/common/configuration.js' ;
16
17
import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js' ;
18
+ import { ILabelService } from '../../../../../platform/label/common/label.js' ;
17
19
import { inputPlaceholderForeground } from '../../../../../platform/theme/common/colorRegistry.js' ;
18
20
import { IThemeService } from '../../../../../platform/theme/common/themeService.js' ;
19
21
import { IChatAgentCommand , IChatAgentData , IChatAgentService } from '../../common/chatAgents.js' ;
20
22
import { chatSlashCommandBackground , chatSlashCommandForeground } from '../../common/chatColors.js' ;
21
- import { ChatRequestAgentPart , ChatRequestAgentSubcommandPart , ChatRequestSlashCommandPart , ChatRequestSlashPromptPart , ChatRequestTextPart , ChatRequestToolPart , ChatRequestToolSetPart , IParsedChatRequestPart , chatAgentLeader , chatSubcommandLeader } from '../../common/chatParserTypes.js' ;
23
+ import { ChatRequestAgentPart , ChatRequestAgentSubcommandPart , ChatRequestDynamicVariablePart , ChatRequestSlashCommandPart , ChatRequestSlashPromptPart , ChatRequestTextPart , ChatRequestToolPart , ChatRequestToolSetPart , IParsedChatRequestPart , chatAgentLeader , chatSubcommandLeader } from '../../common/chatParserTypes.js' ;
22
24
import { ChatRequestParser } from '../../common/chatRequestParser.js' ;
23
25
import { IChatWidget } from '../chat.js' ;
24
26
import { ChatWidget } from '../chatWidget.js' ;
@@ -46,7 +48,8 @@ class InputEditorDecorations extends Disposable {
46
48
@ICodeEditorService private readonly codeEditorService : ICodeEditorService ,
47
49
@IThemeService private readonly themeService : IThemeService ,
48
50
@IChatAgentService private readonly chatAgentService : IChatAgentService ,
49
- @IConfigurationService private readonly configurationService : IConfigurationService
51
+ @IConfigurationService private readonly configurationService : IConfigurationService ,
52
+ @ILabelService private readonly labelService : ILabelService ,
50
53
) {
51
54
super ( ) ;
52
55
@@ -258,6 +261,11 @@ class InputEditorDecorations extends Disposable {
258
261
varDecorations . push ( { range : tool . editorRange } ) ;
259
262
}
260
263
264
+ const dynamicVariableParts = parsedRequest . filter ( ( p ) : p is ChatRequestDynamicVariablePart => p instanceof ChatRequestDynamicVariablePart ) ;
265
+ for ( const variable of dynamicVariableParts ) {
266
+ varDecorations . push ( { range : variable . editorRange , hoverMessage : URI . isUri ( variable . data ) ? new MarkdownString ( this . labelService . getUriLabel ( variable . data , { relative : true } ) ) : undefined } ) ;
267
+ }
268
+
261
269
this . widget . inputEditor . setDecorationsByType ( decorationDescription , variableTextDecorationType , varDecorations ) ;
262
270
}
263
271
}
0 commit comments