mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Auto merge of #14745 - rkstgr:rust-dependencies-sorted, r=HKalbasi
Sort rust dependencies in vscode tree view Sorts alphabetically based on dependency name. Fixes #14729
This commit is contained in:
commit
a4966c9282
1 changed files with 9 additions and 5 deletions
|
@ -85,11 +85,15 @@ export class RustDependenciesProvider
|
||||||
);
|
);
|
||||||
const crates = dependenciesResult.crates;
|
const crates = dependenciesResult.crates;
|
||||||
|
|
||||||
return crates.map((crate) => {
|
return crates
|
||||||
const dep = this.toDep(crate.name || "unknown", crate.version || "", crate.path);
|
.map((crate) => {
|
||||||
this.dependenciesMap[dep.dependencyPath.toLowerCase()] = dep;
|
const dep = this.toDep(crate.name || "unknown", crate.version || "", crate.path);
|
||||||
return dep;
|
this.dependenciesMap[dep.dependencyPath.toLowerCase()] = dep;
|
||||||
});
|
return dep;
|
||||||
|
})
|
||||||
|
.sort((a, b) => {
|
||||||
|
return a.label.localeCompare(b.label);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private toDep(moduleName: string, version: string, path: string): Dependency {
|
private toDep(moduleName: string, version: string, path: string): Dependency {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue