Skip to content

Commit 1986c6f

Browse files
committed
fix: Do not even create the language client until the configuration is loaded
1 parent f5fcc44 commit 1986c6f

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/languageClient.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,18 @@ export class LanguageClientManager implements LanguageClient {
115115
return ErrorAction.Continue
116116
}
117117

118-
start (): void {
118+
public async start (): Promise<void> {
119+
try {
120+
await loadExtensionConfigurations([this.id], this.useMutualizedProxy)
121+
} catch (error) {
122+
console.error('Unable to load extension configuration', error)
123+
}
124+
if (!this.isDisposed()) {
125+
this._start()
126+
}
127+
}
128+
129+
private _start (): void {
119130
const onServerResponse = new Emitter<void>()
120131

121132
const languageClient = createLanguageClient(
@@ -230,13 +241,7 @@ export class LanguageClientManager implements LanguageClient {
230241

231242
this.languageClient.registerFeature(new WillDisposeFeature(this.languageClient, this.onWillShutdownEmitter))
232243

233-
loadExtensionConfigurations([this.id], this.mutualized).catch(error => {
234-
console.error('Unable to load extension configuration', error)
235-
}).finally(() => {
236-
if (!this.isDisposed()) {
237-
this.languageClient!.start()
238-
}
239-
})
244+
this.languageClient.start()
240245
}
241246

242247
sendNotification (method: string, params: unknown): void {

0 commit comments

Comments
 (0)