Skip to content

Commit e228f2a

Browse files
authored
Add cancel to typescript promise rejection (microsoft#138333)
Fixes microsoft#138269
1 parent 93347ca commit e228f2a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

extensions/typescript-language-features/src/typescriptServiceClient.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,11 +1059,13 @@ function getDignosticsKind(event: Proto.Event) {
10591059
}
10601060

10611061
class ServerInitializingIndicator extends Disposable {
1062-
private _task?: { project: string | undefined, resolve: () => void, reject: () => void };
1062+
private _task?: { project: string | undefined, resolve: () => void, reject: (error: Error) => void };
10631063

10641064
public reset(): void {
10651065
if (this._task) {
1066-
this._task.reject();
1066+
const error = new Error('Canceled');
1067+
error.name = error.message;
1068+
this._task.reject(error);
10671069
this._task = undefined;
10681070
}
10691071
}

0 commit comments

Comments
 (0)