Skip to content

Commit 04036ba

Browse files
authored
Clear diff editor before disposing its TextModels (microsoft#223548)
1 parent 3202fa6 commit 04036ba

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export class ChatTextEditContentPart extends Disposable implements IChatContentP
7575
this._register(toDisposable(() => {
7676
isDisposed = true;
7777
cts.dispose(true);
78+
this.ref?.object.clearModel();
7879
}));
7980

8081
this.ref = this._register(diffEditorPool.get());

src/vs/workbench/contrib/chat/browser/codeBlockPart.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,10 @@ export class CodeCompareBlockPart extends Disposable {
786786
diffEditor: this.diffEditor,
787787
} satisfies ICodeCompareBlockActionContext;
788788
}
789+
790+
clearModel() {
791+
this.diffEditor.setModel(null);
792+
}
789793
}
790794

791795
export class DefaultChatTextEditor {

0 commit comments

Comments
 (0)