1

My need is to understand an existing Rust codebase.

I have the ability to see the module/trait/function hierarchy using rustdoc, and to quickly jump to refs and defs using VS Codium (privacy respecting VS Code), but would like a tool to help with things like generating and browsing the static call graph.

I've been searching and asking around for a couple of days without success, so asking: What free static analysis tools are available for Rust?

1 Answer 1

0

Call Hierarchy is available in VSCode / VSCodium but only if you have rust-analyzer rather than RLS selected.

Using rust-analyzer you will have "Show Call Hierarchy" on the right-click menu.

If you are using RLS, as the Rust-client: Engine setting change it to rust-analyzer by typing Ctrl-, to get to settings, then type 'Rust' to filter the list and scroll to 'Rust-client: Engine' and choose 'rust-analyzer'. You will also need to close and re-open the workspace.

3
  • unfortunately the call hierarchy feature has never worked on VSCode with rust-analyzer, I really hope that it lands one day Sep 16, 2020 at 21:48
  • It works for me.
    – happybeing
    Sep 20, 2020 at 16:37
  • ah, looks like it just doesn't work with generics or trait implementations Sep 21, 2020 at 18:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.