diff options
| author | vsrs <vit@conrlab.com> | 2021-01-25 16:38:58 +0300 |
|---|---|---|
| committer | vsrs <vit@conrlab.com> | 2021-01-25 17:46:03 +0300 |
| commit | 185cd736a6da34891a9a5c5e9a2457eb075e565b (patch) | |
| tree | ed0925d3edbe31d06b10e08917be341d382b8fd2 /docs/dev | |
| parent | 3f0e34e08ec15b34bbda06ec0e328113086d856d (diff) | |
| download | rust-185cd736a6da34891a9a5c5e9a2457eb075e565b.tar.gz rust-185cd736a6da34891a9a5c5e9a2457eb075e565b.zip | |
Add RA_WAIT_DBG and docs
Diffstat (limited to 'docs/dev')
| -rw-r--r-- | docs/dev/debugging.md | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/dev/debugging.md b/docs/dev/debugging.md index 8c48fd5a1fe..cc7a790ff46 100644 --- a/docs/dev/debugging.md +++ b/docs/dev/debugging.md @@ -57,6 +57,14 @@ To apply changes to an already running debug process, press <kbd>Ctrl+Shift+P</k - Go back to the `[Extension Development Host]` instance and hover over a Rust variable and your breakpoint should hit. +If you need to debug the server from the very beginning, including its initialization code, you can use the `--wait-dbg` command line argument or `RA_WAIT_DBG` environment variable. The server will spin at the beginning of the `try_main` function (see `crates\rust-analyzer\src\bin\main.rs`) +```rust + let mut d = 4; + while d == 4 { // set a breakpoint here and change the value + d = 4; + } +``` + ## Demo - [Debugging TypeScript VScode extension](https://www.youtube.com/watch?v=T-hvpK6s4wM). |
