提交 d84b5eb2 编写于 作者: I isidor

bulkFileEdits: do not use file trash flag

上级 6541e52b
...@@ -1387,6 +1387,7 @@ export interface WorkspaceFileEditOptions { ...@@ -1387,6 +1387,7 @@ export interface WorkspaceFileEditOptions {
recursive?: boolean; recursive?: boolean;
copy?: boolean; copy?: boolean;
folder?: boolean; folder?: boolean;
doNotUseTrash?: boolean;
} }
export interface WorkspaceFileEdit { export interface WorkspaceFileEdit {
......
...@@ -6262,6 +6262,7 @@ declare namespace monaco.languages { ...@@ -6262,6 +6262,7 @@ declare namespace monaco.languages {
recursive?: boolean; recursive?: boolean;
copy?: boolean; copy?: boolean;
folder?: boolean; folder?: boolean;
doNotUseTrash?: boolean;
} }
export interface WorkspaceFileEdit { export interface WorkspaceFileEdit {
......
...@@ -172,7 +172,7 @@ class DeleteOperation implements IFileOperation { ...@@ -172,7 +172,7 @@ class DeleteOperation implements IFileOperation {
} }
} }
const useTrash = this._fileService.hasCapability(this.oldUri, FileSystemProviderCapabilities.Trash) && this._configurationService.getValue<boolean>('files.enableTrash'); const useTrash = this._fileService.hasCapability(this.oldUri, FileSystemProviderCapabilities.Trash) && this._configurationService.getValue<boolean>('files.enableTrash') && !this.options.doNotUseTrash;
await this._workingCopyFileService.delete([this.oldUri], { useTrash, recursive: this.options.recursive, ...this.undoRedoInfo }); await this._workingCopyFileService.delete([this.oldUri], { useTrash, recursive: this.options.recursive, ...this.undoRedoInfo });
return this._instaService.createInstance(CreateOperation, this.oldUri, this.options, { isUndoing: true }, contents); return this._instaService.createInstance(CreateOperation, this.oldUri, this.options, { isUndoing: true }, contents);
} }
......
...@@ -226,8 +226,7 @@ async function deleteFiles(explorerService: IExplorerService, bulkEditService: I ...@@ -226,8 +226,7 @@ async function deleteFiles(explorerService: IExplorerService, bulkEditService: I
// Call function // Call function
try { try {
const resourceFileEdits = distinctElements.map(e => new ResourceFileEdit(e.resource, undefined, { recursive: true })); const resourceFileEdits = distinctElements.map(e => new ResourceFileEdit(e.resource, undefined, { recursive: true, doNotUseTrash: !useTrash }));
// TODO@Isidor respect the useTrash parameter
await bulkEditService.apply(resourceFileEdits, { await bulkEditService.apply(resourceFileEdits, {
undoRedoSource: explorerService.undoRedoSource, undoRedoSource: explorerService.undoRedoSource,
label: distinctElements.length > 1 ? nls.localize('deleteBulkEdit', "Delete {0} files", distinctElements.length) : nls.localize('deleteFileBulkEdit', "Delete {0}", distinctElements[0].name) label: distinctElements.length > 1 ? nls.localize('deleteBulkEdit', "Delete {0} files", distinctElements.length) : nls.localize('deleteFileBulkEdit', "Delete {0}", distinctElements[0].name)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册