Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 7dfef85

Browse files
committed
fix: add a toggle to disable the dependency explorer.
1 parent eee6872 commit 7dfef85

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

editors/code/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,11 @@
465465
"default": true,
466466
"type": "boolean"
467467
},
468+
"rust-analyzer.showDependenciesExplorer": {
469+
"markdownDescription": "Whether to show the dependencies view.",
470+
"default": true,
471+
"type": "boolean"
472+
},
468473
"$generated-start": {},
469474
"rust-analyzer.assist.emitMustUse": {
470475
"markdownDescription": "Whether to insert #[must_use] when generating `as_` methods\nfor enum variants.",
@@ -2013,7 +2018,7 @@
20132018
{
20142019
"id": "rustDependencies",
20152020
"name": "Rust Dependencies",
2016-
"when": "inRustProject"
2021+
"when": "inRustProject && config.rust-analyzer.showDependenciesExplorer"
20172022
}
20182023
]
20192024
},

editors/code/src/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,10 @@ export class Config {
284284
get useRustcErrorCode() {
285285
return this.get<boolean>("diagnostics.useRustcErrorCode");
286286
}
287+
288+
get showDependenciesExplorer() {
289+
return this.get<boolean>("showDependenciesExplorer");
290+
}
287291
}
288292

289293
// the optional `cb?` parameter is meant to be used to add additional

editors/code/src/ctx.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,10 @@ export class Ctx {
263263
}
264264
await client.start();
265265
this.updateCommands();
266-
this.prepareTreeDependenciesView(client);
266+
267+
if (this.config.showDependenciesExplorer) {
268+
this.prepareTreeDependenciesView(client);
269+
}
267270
}
268271

269272
private prepareTreeDependenciesView(client: lc.LanguageClient) {

0 commit comments

Comments
 (0)