rls
rls copied to clipboard
[rls-data] request: include the crate type somewhere
I'm working on a project that consumes rls-analysis data to analyze programs, and one issue I've hit a few times is that it's pretty common for a project to have two crates with the same name, where one is a library and one is a binary. I want to be able to differentiate them in a human-readable way (i.e. some way besides the random differentiator number) by saying "crate_name (bin)" or "crate_name (lib)".
Right now the only way to figure out which is which is to parse the rustc compilation options in rls_data::Analysis.compilation
and look for the --crate-type
argument, but this seems kind of janky to me.
It'd be cool if this could be parsed out and made available alongside the rest of the crate metadata.