@@ -456,10 +456,6 @@ export class SessionManager {
456
456
connectFunc ,
457
457
clientOptions ) ;
458
458
459
- // Send the new LanguageClient to extension features
460
- // so that they can register their message handlers
461
- // before the connection is established.
462
- this . updateExtensionFeatures ( this . languageServerClient ) ;
463
459
464
460
this . languageServerClient . onReady ( ) . then (
465
461
( ) => {
@@ -474,14 +470,19 @@ export class SessionManager {
474
470
: this . versionDetails . displayVersion ,
475
471
SessionStatus . Running ) ;
476
472
} ) ;
473
+
474
+ // Send the new LanguageClient to extension features
475
+ // so that they can register their message handlers
476
+ // before the connection is established.
477
+ this . updateExtensionFeatures ( this . languageServerClient ) ;
478
+ this . languageServerClient . onNotification (
479
+ RunspaceChangedEvent . type ,
480
+ ( runspaceDetails ) => { this . setStatusBarVersionString ( runspaceDetails ) ; } ) ;
477
481
} ,
478
482
( reason ) => {
479
483
this . setSessionFailure ( "Could not start language service: " , reason ) ;
480
484
} ) ;
481
485
482
- this . languageServerClient . onNotification (
483
- RunspaceChangedEvent . type ,
484
- ( runspaceDetails ) => { this . setStatusBarVersionString ( runspaceDetails ) ; } ) ;
485
486
486
487
this . languageServerClient . start ( ) ;
487
488
}
@@ -768,4 +769,4 @@ export interface RunspaceDetails {
768
769
769
770
export namespace RunspaceChangedEvent {
770
771
export const type = new NotificationType < RunspaceDetails , void > ( 'powerShell/runspaceChanged' ) ;
771
- }
772
+ }
0 commit comments