-
Notifications
You must be signed in to change notification settings - Fork 26
How do you run an analysis? #151
Comments
The this works is that you need to provide save-analysis data to this crate. The easiest way to do that is to run a nightly compiler with |
I think you accidentally linked to the same thing twice. But yeah, I can see the save analysis data generated in JSON after running it! However, a couple of lines in the linked code don't make sense to me. With https://github.com/nrc/cargo-src/blob/34b3b4cae63ed2de53672135cac8a4ffa5b26a71/src/build.rs#L19 https://github.com/nrc/cargo-src/blob/34b3b4cae63ed2de53672135cac8a4ffa5b26a71/src/build.rs#L71-L75 make me think it should be saved under and it seems (Not sure why the code snippets aren't being rendered 🙁 ) |
Sorry the second link should have been: https://github.com/nrc/cargo-src/blob/master/src/file_controller/mod.rs#L187-L192 You can generate the data wherever you like. The RLS creates a separate directory for building (target/rls) and so looks in there. That is how path_prefix and base_dir are somewhat confusing. |
Pasting my Reddit comment here:
I got a suggestion that I should use this crate. Looking at the source code here/in
rls
, I can't really tell what is going on :(. For example, if I haveI'd naively expect that I'll get the ids of
rls-analysis
crate and its dependencies (transitively), and then I can callfor_each_child_def
to recursively traverse all the modules in a crate. Instead I get an empty vector, so it seems like nothing has been analyzed yet. Am I vaguely on the right track or way off the mark?The other option I'm exploring is using
syn
to parse stuff (which is working ok) and implement the module traversal/Cargo.toml
parsing myself.I understand that writing a long explanation might be too much work and you may not have the time; in that case, a pointer to roughly the right place(s) in the code would still be appreciated.
The text was updated successfully, but these errors were encountered: