src/chromium/build-rules/vscode.md
Types are elided in Rust code, which makes a good IDE even more useful than for C++. Visual Studio code works well for Rust in Chromium. To use it,
rust-analyzer extension, not earlier forms of
Rust supportgn gen out/Debug --export-rust-project (or equivalent for your output
directory)ln -s out/Debug/rust-project.json rust-project.jsonA demo of some of the code annotation and exploration features of rust-analyzer might be beneficial if the audience are naturally skeptical of IDEs.
The following steps may help with the demo (but feel free to instead use a piece of Chromium-related Rust that you are most familiar with):
components/qr_code_generator/qr_code_generator_ffi_glue.rsQrCode::new call (around line 26) in
`qr_code_generator_ffi_glue.rs//third_party/rust/.../qr_code-.../src/lib.rs.)QrCode::with_bits method (around line
164; the outline is in the file explorer pane in vscode; typical vim/CoC
bindings = space o)QrCode::with_bits method)It may be worth pointing out that gn gen ... --export-rust-project will need
to be rerun after editing BUILD.gn files (which we will do a few times
throughout the exercises in this session).