Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

Commit c75c30b

Browse files
authored
Merge pull request #827 from gentoo90/rust-alalyzer-without-rustup
Fix: respect `rust-client.disableRustup` setting when using rust-analyzer
2 parents 22998c2 + 83187cf commit c75c30b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@
221221
"rust-client.disableRustup": {
222222
"type": "boolean",
223223
"default": false,
224-
"description": "Disable usage of rustup and use rustc/rls from PATH."
224+
"description": "Disable usage of rustup and use rustc/rls/rust-analyzer from PATH."
225225
},
226226
"rust-client.channel": {
227227
"anyOf": [

src/rustAnalyzer.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,11 @@ export async function createLanguageClient(
216216
rustAnalyzer: { path?: string; releaseTag: string };
217217
},
218218
): Promise<lc.LanguageClient> {
219-
await rustup.ensureToolchain(config.rustup);
220-
await rustup.ensureComponents(config.rustup, REQUIRED_COMPONENTS);
219+
if (!config.rustup.disabled) {
220+
await rustup.ensureToolchain(config.rustup);
221+
await rustup.ensureComponents(config.rustup, REQUIRED_COMPONENTS);
222+
}
223+
221224
if (!config.rustAnalyzer.path) {
222225
await getServer({
223226
askBeforeDownload: true,

0 commit comments

Comments
 (0)