Hook custom editor backup cancellation into the extension layer

This commit is contained in:
Matt Bierner
2020-11-10 15:06:59 -08:00
parent 7a4e81a674
commit 2b820b4bff

View File

@@ -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