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?

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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