提交 d84b5eb2 编写于 作者: I isidor

bulkFileEdits: do not use file trash flag

上级 6541e52b
......@@ -1387,6 +1387,7 @@ export interface WorkspaceFileEditOptions {
recursive?: boolean;
copy?: boolean;
folder?: boolean;
doNotUseTrash?: boolean;
}
export interface WorkspaceFileEdit {
......
......@@ -6262,6 +6262,7 @@ declare namespace monaco.languages {
recursive?: boolean;
copy?: boolean;
folder?: boolean;
doNotUseTrash?: boolean;
}
export interface WorkspaceFileEdit {
......
......@@ -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 });
return this._instaService.createInstance(CreateOperation, this.oldUri, this.options, { isUndoing: true }, contents);
}
......
......@@ -226,8 +226,7 @@ async function deleteFiles(explorerService: IExplorerService, bulkEditService: I
// Call function
try {
const resourceFileEdits = distinctElements.map(e => new ResourceFileEdit(e.resource, undefined, { recursive: true }));
// TODO@Isidor respect the useTrash parameter
const resourceFileEdits = distinctElements.map(e => new ResourceFileEdit(e.resource, undefined, { recursive: true, doNotUseTrash: !useTrash }));
await bulkEditService.apply(resourceFileEdits, {
undoRedoSource: explorerService.undoRedoSource,
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.
先完成此消息的编辑!
想要评论请 注册