diff options
| author | Daan Sieben <daan.sieben@philips.com> | 2024-10-21 10:58:54 +0200 |
|---|---|---|
| committer | Daan Sieben <daan.sieben@philips.com> | 2024-10-21 10:58:54 +0200 |
| commit | 4dd2af5113c975f865da460f166ea0809cf51c3b (patch) | |
| tree | 5d6e8a59bd0c32d9a9d846cea3c0d064c953675c /src/tools/rust-analyzer/editors/code | |
| parent | f21a01f5effe69d39100ae5bf68317f3f67ceb09 (diff) | |
| download | rust-4dd2af5113c975f865da460f166ea0809cf51c3b.tar.gz rust-4dd2af5113c975f865da460f166ea0809cf51c3b.zip | |
feat: support initializeStopped setting
Diffstat (limited to 'src/tools/rust-analyzer/editors/code')
| -rw-r--r-- | src/tools/rust-analyzer/editors/code/package.json | 5 | ||||
| -rw-r--r-- | src/tools/rust-analyzer/editors/code/src/config.ts | 4 | ||||
| -rw-r--r-- | src/tools/rust-analyzer/editors/code/src/main.ts | 9 |
3 files changed, 17 insertions, 1 deletions
diff --git a/src/tools/rust-analyzer/editors/code/package.json b/src/tools/rust-analyzer/editors/code/package.json index 6c7f402dc5f..8005527d2fa 100644 --- a/src/tools/rust-analyzer/editors/code/package.json +++ b/src/tools/rust-analyzer/editors/code/package.json @@ -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" } } }, diff --git a/src/tools/rust-analyzer/editors/code/src/config.ts b/src/tools/rust-analyzer/editors/code/src/config.ts index abb4099f9f5..67bc72f1e12 100644 --- a/src/tools/rust-analyzer/editors/code/src/config.ts +++ b/src/tools/rust-analyzer/editors/code/src/config.ts @@ -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 { diff --git a/src/tools/rust-analyzer/editors/code/src/main.ts b/src/tools/rust-analyzer/editors/code/src/main.ts index 0ddc5619e99..fdf43f66f94 100644 --- a/src/tools/rust-analyzer/editors/code/src/main.ts +++ b/src/tools/rust-analyzer/editors/code/src/main.ts @@ -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; } |
