Skip to content

Commit bfee2e5

Browse files
author
Benjamin Pasero
committed
textfiles - add comment
1 parent 27713ad commit bfee2e5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/vs/workbench/services/textfile/browser/textFileService.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,13 @@ export abstract class AbstractTextFileService extends Disposable implements ITex
283283
// before event
284284
await this._onWillRunOperation.fireAsync({ operation: FileOperation.DELETE, target: resource }, CancellationToken.None);
285285

286+
// Check for any existing dirty file model for the resource
287+
// and do a soft revert before deleting to be able to close
288+
// any opened editor with these files
286289
const dirtyFiles = this.getDirtyFileModels().map(dirtyFileModel => dirtyFileModel.resource).filter(dirty => isEqualOrParent(dirty, resource));
287290
await this.doRevertFiles(dirtyFiles, { soft: true });
288291

292+
// Now actually delete from disk
289293
await this.fileService.del(resource, options);
290294

291295
// after event

0 commit comments

Comments
 (0)