Skip to content

Rust

Language server: rust-analyzer

rust-analyzer ships with rustup:

Terminal window
rustup component add rust-analyzer

Or download from GitHub releases.

  • Cargo.toml at project root
  • Rust toolchain installed

Cargo.toml is auto-detected. For workspace crates:

Terminal window
cd my-rust-workspace
krait init # detects all member crates
  • find symbol — functions, structs, enums, traits, impls
  • hover — Rust types, trait bounds, doc comments
  • checkcargo check errors surfaced via LSP
  • edit replace — replaces function/impl bodies
  • rename — cross-file rename
  • find refs — all usages

Use dotted notation for trait/impl methods:

Terminal window
krait read symbol MyStruct.my_method
krait hover MyStruct.my_method

rust-analyzer may take 10-30s to fully load a large workspace on first start. Subsequent warm queries are 30-80ms.