diff --git a/src/chromium/build-rules/vscode.md b/src/chromium/build-rules/vscode.md index 7cc4c9c6..9f819e2d 100644 --- a/src/chromium/build-rules/vscode.md +++ b/src/chromium/build-rules/vscode.md @@ -12,6 +12,27 @@ for C++. Visual Studio code works well for Rust in Chromium. To use it, Example screenshot from VSCode
+ A demo of some of the code annotation and exploration features of rust-analyzer might be beneficial if the audience are naturally skeptical of IDEs. -
\ No newline at end of file + +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): + +* Open `components/qr_code_generator/qr_code_generator_ffi_glue.rs` +* Place the cursor over the `QrCode::new` call (around line 26) in + `qr_code_generator_ffi_glue.rs +* Demo **show documentation** (typical bindings: vscode = ctrl k i; vim/CoC = K). +* Demo **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). + (This will take you to `//third_party/rust/.../qr_code-.../src/lib.rs`.) +* Demo **outline** and navigate to the `QrCode::with_bits` method (around line + 164; the outline is in the file explorer pane in vscode; typical vim/CoC + bindings = space o) +* Demo **type annotations** (there are quote a few nice examples in the + `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). + +