mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 18:23:49 +00:00
feat: support initializeStopped setting
This commit is contained in:
parent
f21a01f5ef
commit
4dd2af5113
@ -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 New Issue
Block a user