Merge from vscode f5044f0910e4aa7e7e06cb509781f3d56e729959 (#4759)

This commit is contained in:
Anthony Dresser
2019-03-29 10:54:38 -07:00
committed by GitHub
parent 37ce37979a
commit a064da642d
25 changed files with 295 additions and 149 deletions

View File

@@ -325,15 +325,15 @@ export class BulkEdit {
} else if (!edit.newUri && edit.oldUri) {
// delete file
if (!options.ignoreIfNotExists || await this._fileService.existsFile(edit.oldUri)) {
if (await this._fileService.existsFile(edit.oldUri)) {
let useTrash = this._configurationService.getValue<boolean>('files.enableTrash');
if (useTrash && !(await this._fileService.hasCapability(edit.oldUri, FileSystemProviderCapabilities.Trash))) {
useTrash = false; // not supported by provider
}
await this._textFileService.delete(edit.oldUri, { useTrash, recursive: options.recursive });
} else if (!options.ignoreIfNotExists) {
throw new Error(`${edit.oldUri} does not exist and can not be deleted`);
}
} else if (edit.newUri && !edit.oldUri) {
// create file
if (options.overwrite === undefined && options.ignoreIfExists && await this._fileService.existsFile(edit.newUri)) {