Skip to content

Commit 8d835ab

Browse files
committed
Always use appendMarkdown
1 parent a02ecda commit 8d835ab

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export class TerminalConfirmationWidgetSubPart extends BaseChatToolInvocationSub
160160
));
161161

162162
if (disclaimer) {
163-
this._appendMarkdownPart(element, disclaimer, codeBlockRenderOptions, true);
163+
this._appendMarkdownPart(element, disclaimer, codeBlockRenderOptions);
164164
}
165165

166166
ChatContextKeys.Editing.hasToolConfirmation.bindTo(this.contextKeyService).set(true);
@@ -227,11 +227,12 @@ export class TerminalConfirmationWidgetSubPart extends BaseChatToolInvocationSub
227227
});
228228
}
229229

230-
private _appendMarkdownPart(container: HTMLElement, message: string | IMarkdownString, codeBlockRenderOptions: ICodeBlockRenderOptions, isDisclaimer = false) {
231-
const part = this._register(this.instantiationService.createInstance(ChatMarkdownContentPart, {
232-
kind: 'markdownContent',
233-
content: typeof message === 'string' ? (isDisclaimer ? new MarkdownString().appendMarkdown(message) : new MarkdownString().appendText(message)) : message
234-
},
230+
private _appendMarkdownPart(container: HTMLElement, message: string | IMarkdownString, codeBlockRenderOptions: ICodeBlockRenderOptions) {
231+
const part = this._register(this.instantiationService.createInstance(ChatMarkdownContentPart,
232+
{
233+
kind: 'markdownContent',
234+
content: typeof message === 'string' ? new MarkdownString().appendMarkdown(message) : message
235+
},
235236
this.context,
236237
this.editorPool,
237238
false,

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ export class ToolConfirmationSubPart extends BaseChatToolInvocationSubPart {
267267
messageSeeMoreObserver.startObserving();
268268

269269
if (disclaimer) {
270-
this._makeMarkdownPart(elements.disclaimer, disclaimer, codeBlockRenderOptions, true);
270+
this._makeMarkdownPart(elements.disclaimer, disclaimer, codeBlockRenderOptions);
271271
} else {
272272
elements.disclaimer.remove();
273273
}
@@ -315,8 +315,22 @@ export class ToolConfirmationSubPart extends BaseChatToolInvocationSubPart {
315315
this.domNode = confirmWidget.domNode;
316316
}
317317

318-
private _makeMarkdownPart(container: HTMLElement, message: string | IMarkdownString, codeBlockRenderOptions: ICodeBlockRenderOptions, isDisclaimer = false) {
319-
const part = this._register(this.instantiationService.createInstance(ChatMarkdownContentPart, { kind: 'markdownContent', content: typeof message === 'string' ? (isDisclaimer ? new MarkdownString().appendMarkdown(message) : new MarkdownString().appendText(message)) : message }, this.context, this.editorPool, false, this.codeBlockStartIndex, this.renderer, undefined, this.currentWidthDelegate(), this.codeBlockModelCollection, { codeBlockRenderOptions }));
318+
private _makeMarkdownPart(container: HTMLElement, message: string | IMarkdownString, codeBlockRenderOptions: ICodeBlockRenderOptions) {
319+
const part = this._register(this.instantiationService.createInstance(ChatMarkdownContentPart,
320+
{
321+
kind: 'markdownContent',
322+
content: typeof message === 'string' ? new MarkdownString().appendMarkdown(message) : message
323+
},
324+
this.context,
325+
this.editorPool,
326+
false,
327+
this.codeBlockStartIndex,
328+
this.renderer,
329+
undefined,
330+
this.currentWidthDelegate(),
331+
this.codeBlockModelCollection,
332+
{ codeBlockRenderOptions }
333+
));
320334
renderFileWidgets(part.domNode, this.instantiationService, this.chatMarkdownAnchorService, this._store);
321335
container.append(part.domNode);
322336

0 commit comments

Comments
 (0)