mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 01:58:53 +01:00
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:
@@ -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 };
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user