Skip to content

Commit 8129ce3

Browse files
authored
Add call to notifyWhenReady, to prevent crash (#3406)
Addresses an issue with a prior change, which added use of languageClient when it may not yet be available. Use requestWhenReady(), to prevent crash.
1 parent 93a88c9 commit 8129ce3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Extension/src/LanguageServer/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ class DefaultClient implements Client {
640640
let params: QueryTranslationUnitSourceParams = {
641641
uri: document.uri.toString()
642642
};
643-
let response: QueryTranslationUnitSourceResult = await this.languageClient.sendRequest(QueryTranslationUnitSourceRequest, params);
643+
let response: QueryTranslationUnitSourceResult = await this.requestWhenReady(() => this.languageClient.sendRequest(QueryTranslationUnitSourceRequest, params));
644644
if (response.configDisposition === QueryTranslationUnitSourceConfigDisposition.ConfigNotNeeded) {
645645
return Promise.resolve();
646646
}

0 commit comments

Comments
 (0)