Skip to content

Commit

Permalink
fix: reveal diffs for chat edits (microsoft#230032)
Browse files Browse the repository at this point in the history
  • Loading branch information
joyceerhl authored Sep 28, 2024
1 parent bd9abc6 commit 541f878
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/vs/workbench/contrib/chat/browser/chatEditingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -708,7 +709,8 @@ class ChatEditingSession extends Disposable implements IChatEditingSession {

private async _acceptTextEdits(resource: URI, textEdits: TextEdit[]): Promise<void> {
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<void> {
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 541f878

Please sign in to comment.