Skip to content

Commit

Permalink
Include members in roots
Browse files Browse the repository at this point in the history
  • Loading branch information
j178 committed Oct 3, 2024
1 parent 5a99867 commit 1bfbb7a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions crates/uv-resolver/src/lock/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,20 @@ impl<'env> TreeDisplay<'env> {
}
}

let members = &lock.manifest.members;
// Compute the root nodes.
let roots = lock
.packages
.iter()
.map(|dist| &dist.id)
.filter(|id| !non_roots.contains(*id))
.collect::<Vec<_>>();
.filter_map(|dist| {
// Always include workspace members in roots.
if !non_roots.contains(&dist.id) || members.contains(dist.name()) {
Some(&dist.id)
} else {
None
}
})
.collect_vec();

Self {
roots,
Expand Down Expand Up @@ -313,7 +320,7 @@ impl<'env> TreeDisplay<'env> {
let mut lines = Vec::new();

if self.packages.is_empty() {
for id in &self.roots {
for &id in &self.roots {
path.clear();
lines.extend(self.visit(Node::Root(id), &mut visited, &mut path));
}
Expand Down

0 comments on commit 1bfbb7a

Please sign in to comment.