diff --git a/src/vs/workbench/api/browser/mainThreadCustomEditors.ts b/src/vs/workbench/api/browser/mainThreadCustomEditors.ts index 410b6b061dc..4af72559d28 100644 --- a/src/vs/workbench/api/browser/mainThreadCustomEditors.ts +++ b/src/vs/workbench/api/browser/mainThreadCustomEditors.ts @@ -604,6 +604,10 @@ class MainThreadCustomEditorModel extends Disposable implements ICustomEditorMod this._proxy.$backup(this._editorResource.toJSON(), this.viewType, token))); this._hotExitState = pendingState; + token.onCancellationRequested(() => { + pendingState.operation.cancel(); + }); + try { const backupId = await pendingState.operation; // Make sure state has not changed in the meantime