File tree Expand file tree Collapse file tree
src/vs/workbench/services/textfile/browser Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments