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:
bors 2023-05-05 21:22:34 +00:00
commit a4966c9282

View File

@ -85,11 +85,15 @@ export class RustDependenciesProvider
);
const crates = dependenciesResult.crates;
return crates.map((crate) => {
const dep = this.toDep(crate.name || "unknown", crate.version || "", crate.path);
this.dependenciesMap[dep.dependencyPath.toLowerCase()] = dep;
return dep;
});
return crates
.map((crate) => {
const dep = this.toDep(crate.name || "unknown", crate.version || "", crate.path);
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 {