mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-14 14:13:58 +00:00
Auto merge of #18359 - Daanoz:support-initializeStopped, r=Veykril
feat: support initializeStopped setting See #18356 Add option to start rust-analyzer in "stopped" state when the extension activates.
This commit is contained in:
commit
b0b5d38768
3 changed files with 17 additions and 1 deletions
|
@ -349,6 +349,11 @@
|
|||
"markdownDescription": "Whether to show the test explorer.",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"rust-analyzer.initializeStopped": {
|
||||
"markdownDescription": "Do not start rust-analyzer server when the extension is activated.",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -330,6 +330,10 @@ export class Config {
|
|||
get statusBarClickAction() {
|
||||
return this.get<string>("statusBar.clickAction");
|
||||
}
|
||||
|
||||
get initializeStopped() {
|
||||
return this.get<boolean>("initializeStopped");
|
||||
}
|
||||
}
|
||||
|
||||
export function prepareVSCodeConfig<T>(resp: T): T {
|
||||
|
|
|
@ -107,7 +107,14 @@ async function activateServer(ctx: Ctx): Promise<RustAnalyzerExtensionApi> {
|
|||
initializeDebugSessionTrackingAndRebuild(ctx);
|
||||
}
|
||||
|
||||
await ctx.start();
|
||||
if (ctx.config.initializeStopped) {
|
||||
ctx.setServerStatus({
|
||||
health: "stopped",
|
||||
});
|
||||
} else {
|
||||
await ctx.start();
|
||||
}
|
||||
|
||||
return ctx;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue