Skip to content

Commit

Permalink
fix: sync revert of chat-created file from SCM with chat editing list…
Browse files Browse the repository at this point in the history
… state (#232375)
  • Loading branch information
joyceerhl authored Oct 27, 2024
1 parent f506989 commit 8717c11
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { IModelService } from '../../../../../editor/common/services/model.js';
import { IResolvedTextEditorModel, ITextModelService } from '../../../../../editor/common/services/resolverService.js';
import { IModelContentChange, IModelContentChangedEvent } from '../../../../../editor/common/textModelEvents.js';
import { localize } from '../../../../../nls.js';
import { FileOperation, IFileService } from '../../../../../platform/files/common/files.js';
import { IFileService } from '../../../../../platform/files/common/files.js';
import { editorSelectionBackground } from '../../../../../platform/theme/common/colorRegistry.js';
import { IUndoRedoService } from '../../../../../platform/undoRedo/common/undoRedo.js';
import { IChatAgentResult } from '../../common/chatAgents.js';
Expand Down Expand Up @@ -152,8 +152,9 @@ export class ChatEditingModifiedFileEntry extends Disposable implements IModifie
this._register(resourceRef);

this._register(this.doc.onDidChangeContent(e => this._mirrorEdits(e)));
this._register(this._fileService.onDidRunOperation(e => {
if (e.operation === FileOperation.DELETE && kind === ChatEditKind.Created && e.resource.toString() === this.resource.toString()) {
this._register(this._fileService.watch(this.resource));
this._register(this._fileService.onDidFilesChange(e => {
if (e.affects(this.resource) && kind === ChatEditKind.Created && e.gotDeleted()) {
this._onDidDelete.fire();
this.dispose();
}
Expand Down

0 comments on commit 8717c11

Please sign in to comment.