Skip to content

Commit 72a2c7c

Browse files
authored
Workaround references list not updating (microsoft#232176)
Not the ideal fix but this makes it so that `ChatCollapsibleListContentPart` does not have a live version of the references list passed to it. The current code results in the item never being re-rendered because `hasSameContent` would always return true, so the references list would not update There are a bunch of layers above this that all say they are readonly arrays too. Being readonly is correct from the consumer side, but it looks like the array does get mutated behind the scenes which is often unexpected
1 parent 2c1d208 commit 72a2c7c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/vs/workbench/contrib/chat/common/chatModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ export class ChatResponseModel extends Disposable implements IChatResponseModel
492492

493493
private readonly _contentReferences: IChatContentReference[] = [];
494494
public get contentReferences(): ReadonlyArray<IChatContentReference> {
495-
return this._contentReferences;
495+
return Array.from(this._contentReferences);
496496
}
497497

498498
private readonly _codeCitations: IChatCodeCitation[] = [];

0 commit comments

Comments
 (0)