don't suppress preview when handling onWill-events anymore, https://github.com/microsoft/vscode/issues/111878

This commit is contained in:
Johannes Rieken 2020-12-17 10:18:23 +01:00
parent a7fbcc27b7
commit 0929ea86cd
3 changed files with 2 additions and 8 deletions

View File

@ -69,7 +69,6 @@ export interface IBulkEditOptions {
progress?: IProgress<IProgressStep>;
token?: CancellationToken;
showPreview?: boolean;
suppressPreview?: boolean;
label?: string;
quotableLabel?: string;
undoRedoSource?: UndoRedoSource;

View File

@ -93,12 +93,7 @@ export class MainThreadFileSystemEventService {
}
const edit = reviveWorkspaceEditDto2(data);
await bulkEditService.apply(edit, {
undoRedoGroupId,
// this is a nested workspace edit, e.g one from a onWill-handler and for now we need to forcefully suppress
// refactor previewing, see: https://github.com/microsoft/vscode/issues/111873#issuecomment-738739852
suppressPreview: true
});
await bulkEditService.apply(edit, { undoRedoGroupId });
}
private _progressLabel(operation: FileOperation): string {
switch (operation) {

View File

@ -139,7 +139,7 @@ export class BulkEditService implements IBulkEditService {
return { ariaSummary: localize('nothing', "Made no edits") };
}
if (this._previewHandler && !options?.suppressPreview && (options?.showPreview || edits.some(value => value.metadata?.needsConfirmation))) {
if (this._previewHandler && (options?.showPreview || edits.some(value => value.metadata?.needsConfirmation))) {
edits = await this._previewHandler(edits, options);
}