mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 15:54:15 +00:00
fix: add a toggle to disable the dependency explorer.
This commit is contained in:
parent
eee6872647
commit
7dfef85be6
@ -465,6 +465,11 @@
|
||||
"default": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"rust-analyzer.showDependenciesExplorer": {
|
||||
"markdownDescription": "Whether to show the dependencies view.",
|
||||
"default": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"$generated-start": {},
|
||||
"rust-analyzer.assist.emitMustUse": {
|
||||
"markdownDescription": "Whether to insert #[must_use] when generating `as_` methods\nfor enum variants.",
|
||||
@ -2013,7 +2018,7 @@
|
||||
{
|
||||
"id": "rustDependencies",
|
||||
"name": "Rust Dependencies",
|
||||
"when": "inRustProject"
|
||||
"when": "inRustProject && config.rust-analyzer.showDependenciesExplorer"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -284,6 +284,10 @@ export class Config {
|
||||
get useRustcErrorCode() {
|
||||
return this.get<boolean>("diagnostics.useRustcErrorCode");
|
||||
}
|
||||
|
||||
get showDependenciesExplorer() {
|
||||
return this.get<boolean>("showDependenciesExplorer");
|
||||
}
|
||||
}
|
||||
|
||||
// the optional `cb?` parameter is meant to be used to add additional
|
||||
|
@ -263,7 +263,10 @@ export class Ctx {
|
||||
}
|
||||
await client.start();
|
||||
this.updateCommands();
|
||||
this.prepareTreeDependenciesView(client);
|
||||
|
||||
if (this.config.showDependenciesExplorer) {
|
||||
this.prepareTreeDependenciesView(client);
|
||||
}
|
||||
}
|
||||
|
||||
private prepareTreeDependenciesView(client: lc.LanguageClient) {
|
||||
|
Loading…
Reference in New Issue
Block a user