Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --use-parents option? #185

Open
smoelius opened this issue Jun 3, 2023 · 1 comment
Open

Add --use-parents option? #185

smoelius opened this issue Jun 3, 2023 · 1 comment

Comments

@smoelius
Copy link
Contributor

smoelius commented Jun 3, 2023

I was going to suggest that we close #18 in light of #184, but it turns out that PR is only a partial solution.

It catches cases like this:

mod a {
  use super::b;
}
mod b {
  use super::a;
}

But it doesn't catch cases like this:

mod a {
  use super::b;
  struct T;
}
mod b {
  use super::a::T;
}

because an edge b --> a::T is not the same as an edge b --> a.

I think the easiest solution would be to add something like --use-parents, which adds an edge b --> a whenever an edge b --> a::T is seen.

@regexident I realize this is "option creep" for a tool not originally intended for this purpose, but would you be open to adding such an option?

@smoelius smoelius changed the title Add --use-parents option Add --use-parents option? Jun 3, 2023
@svix-jplatte
Copy link

This would also allow to generate a graph of actual module dependencies without rendering every single item per module, right? For large (binary) crates, it would be very nice if this tool could help identify easy modules to move out into separate crates, but currently due to the size of the output when only showing modules, it's not really feasible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants