File tree 3 files changed +17
-1
lines changed
3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 349
349
"markdownDescription" : " Whether to show the test explorer." ,
350
350
"default" : false ,
351
351
"type" : " boolean"
352
+ },
353
+ "rust-analyzer.initializeStopped" : {
354
+ "markdownDescription" : " Do not start rust-analyzer server when the extension is activated." ,
355
+ "default" : false ,
356
+ "type" : " boolean"
352
357
}
353
358
}
354
359
},
Original file line number Diff line number Diff line change @@ -330,6 +330,10 @@ export class Config {
330
330
get statusBarClickAction ( ) {
331
331
return this . get < string > ( "statusBar.clickAction" ) ;
332
332
}
333
+
334
+ get initializeStopped ( ) {
335
+ return this . get < boolean > ( "initializeStopped" ) ;
336
+ }
333
337
}
334
338
335
339
export function prepareVSCodeConfig < T > ( resp : T ) : T {
Original file line number Diff line number Diff line change @@ -107,7 +107,14 @@ async function activateServer(ctx: Ctx): Promise<RustAnalyzerExtensionApi> {
107
107
initializeDebugSessionTrackingAndRebuild ( ctx ) ;
108
108
}
109
109
110
- await ctx . start ( ) ;
110
+ if ( ctx . config . initializeStopped ) {
111
+ ctx . setServerStatus ( {
112
+ health : "stopped" ,
113
+ } ) ;
114
+ } else {
115
+ await ctx . start ( ) ;
116
+ }
117
+
111
118
return ctx ;
112
119
}
113
120
You can’t perform that action at this time.
0 commit comments