I'm exploring ways to crawl crates available on crates.io for indexing and analysis. I'd like to record where unsafe blocks occur and item usage (items being macros, enums, structs, traits, functions & methods). I have a couple of fun (and useful) ideas of what could be done with the ability to dump that information for every crate on crates.io.
Currently I'm trying to figure out whether it would be better to try to utilize the RLS or clippy to do this.
I've done a little experimenting with clippy. It looks like the LateContext gives me basically what I need with access to the HIR, but I've been having trouble trying to resolve types on expressions. I've also found that clippy actually runs (but in a mostly silent mode) on dependencies of the current crate which is very, very conventient.
I've looked at some of the test data for the RLS and it looks like I'd have to invoke it and redo work in order to get at the non-public data of the crate (e.g. usage of items). I also don't know if has access to HIR, but I'm not sure I'd actually need it.
So hopefully somebody who is familiar with clippy and the RLS can weigh in and let me know if they have any opinions on if this is actually doable, and if so, which path is least painful.
I know that clippy relies heavily on rustc internals, but at this point it seems like the way to go.