From 83187cf61d991f193df36fb4df203295c67f7efb Mon Sep 17 00:00:00 2001 From: gentoo90 Date: Tue, 28 Jul 2020 18:26:19 +0300 Subject: [PATCH] Fix: respect `rust-client.disableRustup` setting when using rust-analyzer --- package.json | 2 +- src/rustAnalyzer.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 8aa60d33..6f611e61 100644 --- a/package.json +++ b/package.json @@ -221,7 +221,7 @@ "rust-client.disableRustup": { "type": "boolean", "default": false, - "description": "Disable usage of rustup and use rustc/rls from PATH." + "description": "Disable usage of rustup and use rustc/rls/rust-analyzer from PATH." }, "rust-client.channel": { "anyOf": [ diff --git a/src/rustAnalyzer.ts b/src/rustAnalyzer.ts index 459312ef..fd6837a1 100644 --- a/src/rustAnalyzer.ts +++ b/src/rustAnalyzer.ts @@ -216,8 +216,11 @@ export async function createLanguageClient( rustAnalyzer: { path?: string; releaseTag: string }; }, ): Promise { - await rustup.ensureToolchain(config.rustup); - await rustup.ensureComponents(config.rustup, REQUIRED_COMPONENTS); + if (!config.rustup.disabled) { + await rustup.ensureToolchain(config.rustup); + await rustup.ensureComponents(config.rustup, REQUIRED_COMPONENTS); + } + if (!config.rustAnalyzer.path) { await getServer({ askBeforeDownload: true,