Completion of Generated Code in IntelliJ Rust

Recently, I’ve been doing a lot of work with Tonic, a Rust implementation of the gRPC protocol. Like many implementations of gRPC, Tonic generates code from the protocol buffers definitions at build time using the tonic-build crate in a Cargo build script, and by default puts them in the path referred to by OUT_DIR. This has the unfortunate side effect that tooling such as IntelliJ Rust does not see the generated code for the purposes of analysis and completion - something very useful for the verbose generated protocol buffers code - unless you take some additional steps.

[Read More]