From 541f878e30173c000d9dc0feb45e36f3fd128c4c Mon Sep 17 00:00:00 2001 From: Joyce Er Date: Fri, 27 Sep 2024 17:33:48 -0700 Subject: [PATCH] fix: reveal diffs for chat edits (#230032) --- src/vs/workbench/contrib/chat/browser/chatEditingService.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/chat/browser/chatEditingService.ts b/src/vs/workbench/contrib/chat/browser/chatEditingService.ts index 3321419dba3a0..14874cf40adf9 100644 --- a/src/vs/workbench/contrib/chat/browser/chatEditingService.ts +++ b/src/vs/workbench/contrib/chat/browser/chatEditingService.ts @@ -574,6 +574,7 @@ class ChatEditingSession extends Disposable implements IChatEditingSession { @ITextModelService private readonly _textModelService: ITextModelService, @IBulkEditService public readonly _bulkEditService: IBulkEditService, @IEditorGroupsService private readonly _editorGroupsService: IEditorGroupsService, + @IEditorService private readonly editorService: IEditorService, ) { super(); } @@ -708,7 +709,8 @@ class ChatEditingSession extends Disposable implements IChatEditingSession { private async _acceptTextEdits(resource: URI, textEdits: TextEdit[]): Promise { const entry = await this._getOrCreateModifiedFileEntry(resource); - entry.appyEdits(textEdits); + entry.applyEdits(textEdits); + await this.editorService.openEditor({ original: { resource: entry.originalURI }, modified: { resource: entry.modifiedURI }, options: { inactive: true } }); } private async _resolve(): Promise { @@ -796,7 +798,7 @@ class ModifiedFileEntry extends Disposable implements IModifiedFileEntry { this._register(resourceRef); } - appyEdits(textEdits: TextEdit[]): void { + applyEdits(textEdits: TextEdit[]): void { this.doc.applyEdits(textEdits); this._stateObs.set(ModifiedFileEntryState.Undecided, undefined); }