mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-15 07:28:05 +00:00
Fix final answer detection in markdown rendering logic (#293746)
* Fix final answer detection in markdown rendering logic * Update src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -2326,7 +2326,9 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
|
||||
|
||||
private renderMarkdown(markdown: IChatMarkdownContent, templateData: IChatListItemTemplate, context: IChatContentPartRenderContext): IChatContentPart {
|
||||
const element = context.element;
|
||||
const isFinalAnswerPart = isResponseVM(element) && element.isComplete && context.contentIndex === context.content.length - 1;
|
||||
const isFinalRenderPass = isResponseVM(element) && element.isComplete && !element.renderData;
|
||||
const lastPinnedPartIndex = isFinalRenderPass ? context.content.findLastIndex(c => c.kind === 'thinking' || c.kind === 'toolInvocation' || c.kind === 'toolInvocationSerialized') : -1;
|
||||
const isFinalAnswerPart = isFinalRenderPass && context.contentIndex > lastPinnedPartIndex;
|
||||
if (!this.hasCodeblockUri(markdown) || isFinalAnswerPart) {
|
||||
this.finalizeCurrentThinkingPart(context, templateData);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user