suppress refactor preview from onWill-handler, workaround for https://github.com/microsoft/vscode/issues/111873

This commit is contained in:
Johannes Rieken
2020-12-04 12:47:27 +01:00
parent de3dd1383c
commit 2e3236827e
3 changed files with 9 additions and 2 deletions

View File

@@ -39,6 +39,12 @@ export class MainThreadBulkEdits implements MainThreadBulkEditsShape {
$tryApplyWorkspaceEdit(dto: IWorkspaceEditDto, undoRedoGroupId?: number): Promise<boolean> {
const edits = reviveWorkspaceEditDto2(dto);
return this._bulkEditService.apply(edits, { undoRedoGroupId }).then(() => true, _err => false);
return this._bulkEditService.apply(edits, {
// having a undoRedoGroupId means that 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
undoRedoGroupId,
suppressPreview: typeof undoRedoGroupId === 'number' ? true : undefined
}).then(() => true, _err => false);
}
}