@@ -31,6 +31,46 @@ function extractTextFromPart(content: IChatThinkingPart): string {
3131 return raw . trim ( ) ;
3232}
3333
34+ function getToolInvocationIcon ( toolId : string ) : ThemeIcon {
35+ const lowerToolId = toolId . toLowerCase ( ) ;
36+
37+ if (
38+ lowerToolId . includes ( 'search' ) ||
39+ lowerToolId . includes ( 'grep' ) ||
40+ lowerToolId . includes ( 'find' ) ||
41+ lowerToolId . includes ( 'list' ) ||
42+ lowerToolId . includes ( 'semantic' ) ||
43+ lowerToolId . includes ( 'changes' ) ||
44+ lowerToolId . includes ( 'codebase' )
45+ ) {
46+ return Codicon . search ;
47+ }
48+
49+ if (
50+ lowerToolId . includes ( 'read' ) ||
51+ lowerToolId . includes ( 'get_file' ) ||
52+ lowerToolId . includes ( 'problems' )
53+ ) {
54+ return Codicon . eye ;
55+ }
56+
57+ if (
58+ lowerToolId . includes ( 'edit' ) ||
59+ lowerToolId . includes ( 'create' )
60+ ) {
61+ return Codicon . pencil ;
62+ }
63+
64+ // default to generic tool icon
65+ return Codicon . tools ;
66+ }
67+
68+ function createThinkingIcon ( icon : ThemeIcon ) : HTMLElement {
69+ const iconElement = $ ( 'span.chat-thinking-icon' ) ;
70+ iconElement . classList . add ( ...ThemeIcon . asClassNameArray ( icon ) ) ;
71+ return iconElement ;
72+ }
73+
3474function extractTitleFromThinkingContent ( content : string ) : string | undefined {
3575 const headerMatch = content . match ( / ^ \* \* ( [ ^ * ] + ) \* \* / ) ;
3676 return headerMatch ? headerMatch [ 1 ] : undefined ;
@@ -198,6 +238,7 @@ export class ChatThinkingContentPart extends ChatCollapsibleContentPart implemen
198238 this . markdownResult = rendered ;
199239 if ( ! target ) {
200240 clearNode ( this . textContainer ) ;
241+ this . textContainer . appendChild ( createThinkingIcon ( Codicon . comment ) ) ;
201242 this . textContainer . appendChild ( rendered . element ) ;
202243 }
203244 }
@@ -432,7 +473,13 @@ export class ChatThinkingContentPart extends ChatCollapsibleContentPart implemen
432473 }
433474
434475 public appendItem ( content : HTMLElement , toolInvocationId ?: string , toolInvocation ?: IChatToolInvocation | IChatToolInvocationSerialized ) : void {
435- this . wrapper . appendChild ( content ) ;
476+ const itemWrapper = $ ( '.chat-thinking-tool-wrapper' ) ;
477+ const icon = toolInvocationId ? getToolInvocationIcon ( toolInvocationId ) : Codicon . tools ;
478+ const iconElement = createThinkingIcon ( icon ) ;
479+ itemWrapper . appendChild ( iconElement ) ;
480+ itemWrapper . appendChild ( content ) ;
481+
482+ this . wrapper . appendChild ( itemWrapper ) ;
436483 if ( toolInvocationId ) {
437484 this . toolInvocationCount ++ ;
438485 let toolCallLabel : string ;
0 commit comments