Skip to content

Commit ec98192

Browse files
authored
Fix layout in tool invocation codeblocks (microsoft#250162)
1 parent 9c362d3 commit ec98192

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolInputOutputContentPart.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,13 @@ export class ChatCollapsibleInputOutputContentPart extends Disposable {
107107
private readonly output: IChatCollapsibleOutputData | undefined,
108108
isError: boolean,
109109
initiallyExpanded: boolean,
110+
width: number,
110111
@IContextKeyService private readonly contextKeyService: IContextKeyService,
111112
@IInstantiationService private readonly _instantiationService: IInstantiationService,
112113
@IContextMenuService private readonly _contextMenuService: IContextMenuService,
113114
) {
114115
super();
116+
this._currentWidth = width;
115117

116118
const titleEl = dom.h('.chat-confirmation-widget-title-inner');
117119
const iconEl = dom.h('.chat-confirmation-widget-title-icon');

src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export class ChatInputOutputMarkdownProgressPart extends BaseChatToolInvocationS
4242
input: string,
4343
output: IToolResultInputOutputDetails['output'] | undefined,
4444
isError: boolean,
45+
currentWidthDelegate: () => number,
4546
@IInstantiationService instantiationService: IInstantiationService,
4647
@IModelService modelService: IModelService,
4748
@ILanguageService languageService: ILanguageService,
@@ -116,6 +117,7 @@ export class ChatInputOutputMarkdownProgressPart extends BaseChatToolInvocationS
116117
},
117118
isError,
118119
ChatInputOutputMarkdownProgressPart._expandedByDefault.get(toolInvocation) ?? false,
120+
currentWidthDelegate(),
119121
));
120122
this._codeblocks.push(...collapsibleListPart.codeblocks);
121123
this._register(collapsibleListPart.onDidChangeHeight(() => this._onDidChangeHeight.fire()));

src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationPart.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ export class ChatToolInvocationPart extends Disposable implements IChatContentPa
111111
this.toolInvocation.originMessage,
112112
this.toolInvocation.resultDetails.input,
113113
this.toolInvocation.resultDetails.output,
114-
!!this.toolInvocation.resultDetails.isError
114+
!!this.toolInvocation.resultDetails.isError,
115+
this.currentWidthDelegate
115116
);
116117
}
117118

@@ -126,7 +127,8 @@ export class ChatToolInvocationPart extends Disposable implements IChatContentPa
126127
this.toolInvocation.originMessage,
127128
typeof this.toolInvocation.toolSpecificData.rawInput === 'string' ? this.toolInvocation.toolSpecificData.rawInput : JSON.stringify(this.toolInvocation.toolSpecificData.rawInput, null, 2),
128129
undefined,
129-
false
130+
false,
131+
this.currentWidthDelegate
130132
);
131133
}
132134

0 commit comments

Comments
 (0)