Skip to content

Commit e41652b

Browse files
authored
Merge pull request #399 from PowerShell/daviwil/extcommand-fix
Fix #396: Extension commands loaded in profile are not being registered
2 parents 54e3784 + bda32ef commit e41652b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/session.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,11 @@ export class SessionManager {
333333
connectFunc,
334334
clientOptions);
335335

336+
// Send the new LanguageClient to extension features
337+
// so that they can register their message handlers
338+
// before the connection is established.
339+
this.updateExtensionFeatures(this.languageServerClient);
340+
336341
this.languageServerClient.onReady().then(
337342
() => {
338343
this.languageServerClient
@@ -345,19 +350,19 @@ export class SessionManager {
345350
? `${this.versionDetails.displayVersion} (${this.versionDetails.architecture})`
346351
: this.versionDetails.displayVersion,
347352
SessionStatus.Running);
348-
349-
this.updateExtensionFeatures(this.languageServerClient)
350353
});
351354
},
352355
(reason) => {
353356
this.setSessionFailure("Could not start language service: ", reason);
357+
this.updateExtensionFeatures(undefined);
354358
});
355359

356360
this.languageServerClient.start();
357361
}
358362
catch (e)
359363
{
360364
this.setSessionFailure("The language service could not be started: ", e);
365+
this.updateExtensionFeatures(undefined);
361366
}
362367
}
363368

0 commit comments

Comments
 (0)