about summary refs log tree commit diff
path: root/docs/dev/debugging.md
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-26 22:37:11 +0000
committerGitHub <noreply@github.com>2021-01-26 22:37:11 +0000
commitfc08fdaf5a5e17af09eb6cfa098f7c3d4dc9114b (patch)
tree1fd1e5d10660f2de31c604806893958a84c4ff4f /docs/dev/debugging.md
parent8775bc4be18fac9c7935c1edeacf048c515e7518 (diff)
parent5f1eb544da9f33f3402914ba5c4318032cbad0c3 (diff)
downloadrust-fc08fdaf5a5e17af09eb6cfa098f7c3d4dc9114b.tar.gz
rust-fc08fdaf5a5e17af09eb6cfa098f7c3d4dc9114b.zip
Merge #7457
7457: Add no-buffering file logging and wait for a debugger option. r=vsrs a=vsrs

Adds two command line flags: `--no-buffering` and `--wait-dbg`. 

Not  sure if someone else needs this, but personally I found both flags extremely useful trying to figure out why RA does not work with Visual Studio. Or better to say why Visual Studio does not work with RA.

Co-authored-by: vsrs <vit@conrlab.com>
Diffstat (limited to 'docs/dev/debugging.md')
-rw-r--r--docs/dev/debugging.md8
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).