cargo-modules icon indicating copy to clipboard operation
cargo-modules copied to clipboard

Option to disable module nodes in graph

Open kangalio opened this issue 3 years ago • 3 comments
trafficstars

I'd love to use cargo modules as a tool to optimize my project's module structure. When rendering items and their interdependencies, the output looks very messy: image

If it were possible to disable modules nodes, this graph would look significantly cleaner but still contain the information about item interdependencies.

kangalio avatar Dec 23 '21 15:12 kangalio

Hi @kangalioo,

I too would love to be able to generate a pure type-dependencies graph, but unfortunately afaiui rust-analyzer (which powers cargo-modules) only provides dependency information on module scope. It's possible that I either missed something when I last looked at the APIs provided by rust-analyzer or that it has since gained support for type-level dependencies.

regexident avatar Dec 23 '21 15:12 regexident

It's possible that I either missed something when I last looked at the APIs provided by rust-analyzer or that it has since gained support for type-level dependencies.

Which crate would I need to look at to double-check? ra_ap_hir?

kangalio avatar Dec 23 '21 16:12 kangalio

Either that or ra_ap_ide_db in my experience. But then again I might have searched in the wrong corners and with the wrong keywords.

regexident avatar Dec 23 '21 22:12 regexident

@kangalio The just released version 0.8.0 provides a --no-modules CLI argument for filtering out modules from graphs.

regexident avatar May 01 '23 19:05 regexident