Setting Up Editor Support for Kernel Rust Code
Modern editors can jump to a definition, show a type, and underline an error as you type, using a background service called rust-analyzer. Kernel code is not an ordinary Rust project, so the kernel generates the configuration file that service needs. Once set up, you get the same help writing a driver that you would get writing an ordinary program. Without it you are reading an unfamiliar codebase with no navigation at all.
Questions this Concept answers
- Why can rust-analyzer not simply use Cargo to understand kernel Rust code?
Quick Start — The Linux Kernel documentation
Editors get go-to-definition, completion and inline error underlining from a background service called rust-analyzer. An ordinary Rust project describes itself to that service through Cargo, but the …