@@ -23,12 +23,12 @@ export class Ctx {
2323 readonly config : Config ;
2424
2525 private client : lc . LanguageClient | undefined ;
26+ private _serverPath : string | undefined ;
27+ private traceOutputChannel : vscode . OutputChannel | undefined ;
28+ private outputChannel : vscode . OutputChannel | undefined ;
29+ private state : PersistentState ;
2630
27- traceOutputChannel : vscode . OutputChannel | undefined ;
28- outputChannel : vscode . OutputChannel | undefined ;
2931 workspace : Workspace ;
30- state : PersistentState ;
31- serverPath : string | undefined ;
3232
3333 constructor ( readonly extCtx : vscode . ExtensionContext , workspace : Workspace ) {
3434 this . statusBar = vscode . window . createStatusBarItem ( vscode . StatusBarAlignment . Left ) ;
@@ -70,21 +70,24 @@ export class Ctx {
7070 if ( ! this . client ) {
7171 log . info ( "Creating language client" ) ;
7272
73- this . serverPath = await bootstrap ( this . extCtx , this . config , this . state ) . catch ( ( err ) => {
74- let message = "bootstrap error. " ;
73+ this . _serverPath = await bootstrap ( this . extCtx , this . config , this . state ) . catch (
74+ ( err ) => {
75+ let message = "bootstrap error. " ;
7576
76- message +=
77- 'See the logs in "OUTPUT > Rust Analyzer Client" (should open automatically). ' ;
78- message += 'To enable verbose logs use { "rust-analyzer.trace.extension": true }' ;
77+ message +=
78+ 'See the logs in "OUTPUT > Rust Analyzer Client" (should open automatically). ' ;
79+ message +=
80+ 'To enable verbose logs use { "rust-analyzer.trace.extension": true }' ;
7981
80- log . error ( "Bootstrap error" , err ) ;
81- throw new Error ( message ) ;
82- } ) ;
82+ log . error ( "Bootstrap error" , err ) ;
83+ throw new Error ( message ) ;
84+ }
85+ ) ;
8386 const newEnv = substituteVariablesInEnv (
8487 Object . assign ( { } , process . env , this . config . serverExtraEnv )
8588 ) ;
8689 const run : lc . Executable = {
87- command : this . serverPath ,
90+ command : this . _serverPath ,
8891 options : { env : newEnv } ,
8992 } ;
9093 const serverOptions = {
@@ -129,7 +132,7 @@ export class Ctx {
129132 async disposeClient ( ) {
130133 log . info ( "Deactivating language client" ) ;
131134 await this . client ?. dispose ( ) ;
132- this . serverPath = undefined ;
135+ this . _serverPath = undefined ;
133136 this . client = undefined ;
134137 }
135138
@@ -161,6 +164,10 @@ export class Ctx {
161164 return this . extCtx . subscriptions ;
162165 }
163166
167+ get serverPath ( ) : string | undefined {
168+ return this . _serverPath ;
169+ }
170+
164171 setServerStatus ( status : ServerStatusParams ) {
165172 let icon = "" ;
166173 const statusBar = this . statusBar ;
0 commit comments