Don't reject status indicator promise

Fixes #138453

Looks like `withProgress` does not handle rejections. To dismiss the indicator, we can simply resolve the promise instead
This commit is contained in:
Matt Bierner
2021-12-07 12:08:39 -08:00
parent 4024a1e84d
commit 26b621a773

View File

@@ -1059,13 +1059,12 @@ function getDignosticsKind(event: Proto.Event) {
}
class ServerInitializingIndicator extends Disposable {
private _task?: { project: string | undefined, resolve: () => void, reject: (error: Error) => void };
private _task?: { project: string | undefined, resolve: () => void };
public reset(): void {
if (this._task) {
const error = new Error('Canceled');
error.name = error.message;
this._task.reject(error);
this._task.resolve();
this._task = undefined;
}
}
@@ -1081,8 +1080,8 @@ class ServerInitializingIndicator extends Disposable {
vscode.window.withProgress({
location: vscode.ProgressLocation.Window,
title: localize('serverLoading.progress', "Initializing JS/TS language features"),
}, () => new Promise<void>((resolve, reject) => {
this._task = { project: projectName, resolve, reject };
}, () => new Promise<void>(resolve => {
this._task = { project: projectName, resolve };
}));
}