diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts index 25a8a7925e6..06422c9d422 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts @@ -926,10 +926,7 @@ suite('vscode API - workspace', () => { assert.ok(await vscode.workspace.applyEdit(we)); const document = await vscode.workspace.openTextDocument(newUri); - // See https://github.com/microsoft/vscode/issues/107739 - // RenameOperation currently saves the file before applying the rename - // so that is why the document is not dirty here - assert.equal(document.isDirty, false); + assert.equal(document.isDirty, true); await document.save(); assert.equal(document.isDirty, false); diff --git a/src/vs/workbench/contrib/bulkEdit/browser/bulkFileEdits.ts b/src/vs/workbench/contrib/bulkEdit/browser/bulkFileEdits.ts index 1fd2fc56977..b584304845d 100644 --- a/src/vs/workbench/contrib/bulkEdit/browser/bulkFileEdits.ts +++ b/src/vs/workbench/contrib/bulkEdit/browser/bulkFileEdits.ts @@ -16,7 +16,6 @@ import { ILogService } from 'vs/platform/log/common/log'; import { VSBuffer } from 'vs/base/common/buffer'; import { ResourceFileEdit } from 'vs/editor/browser/services/bulkEditService'; import * as resources from 'vs/base/common/resources'; -import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; interface IFileOperation { uris: URI[]; @@ -39,7 +38,6 @@ class RenameOperation implements IFileOperation { readonly options: WorkspaceFileEditOptions, @IWorkingCopyFileService private readonly _workingCopyFileService: IWorkingCopyFileService, @IFileService private readonly _fileService: IFileService, - @ITextFileService private readonly _textFileService: ITextFileService, ) { } get uris() { @@ -52,17 +50,8 @@ class RenameOperation implements IFileOperation { return new Noop(); // not overwriting, but ignoring, and the target file exists } - // See https://github.com/microsoft/vscode/issues/107739 - // `IWorkingCopyFileService.move` ends up pushing to the undo/redo service - // if we attempt to move a dirty file. - try { - await this._textFileService.save(this.oldUri, { - skipSaveParticipants: true - }); - } catch (err) { } - await this._workingCopyFileService.move([{ source: this.oldUri, target: this.newUri }], { overwrite: this.options.overwrite }); - return new RenameOperation(this.oldUri, this.newUri, this.options, this._workingCopyFileService, this._fileService, this._textFileService); + return new RenameOperation(this.oldUri, this.newUri, this.options, this._workingCopyFileService, this._fileService); } toString(): string {