From 185cd736a6da34891a9a5c5e9a2457eb075e565b Mon Sep 17 00:00:00 2001 From: vsrs Date: Mon, 25 Jan 2021 16:38:58 +0300 Subject: [PATCH] Add RA_WAIT_DBG and docs --- crates/rust-analyzer/src/bin/args.rs | 1 + crates/rust-analyzer/src/bin/main.rs | 2 +- docs/dev/debugging.md | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/rust-analyzer/src/bin/args.rs b/crates/rust-analyzer/src/bin/args.rs index abc00d03bb..c5f8140216 100644 --- a/crates/rust-analyzer/src/bin/args.rs +++ b/crates/rust-analyzer/src/bin/args.rs @@ -57,6 +57,7 @@ FLAGS: ENVIRONMENTAL VARIABLES: RA_LOG Set log filter in env_logger format RA_PROFILE Enable hierarchical profiler + RA_WAIT_DBG If set acts like a --wait-dbg flag COMMANDS: diff --git a/crates/rust-analyzer/src/bin/main.rs b/crates/rust-analyzer/src/bin/main.rs index 0cddfecb57..80637cbfff 100644 --- a/crates/rust-analyzer/src/bin/main.rs +++ b/crates/rust-analyzer/src/bin/main.rs @@ -29,7 +29,7 @@ fn main() { fn try_main() -> Result<()> { let args = args::Args::parse()?; - if args.wait_dbg { + if args.wait_dbg || env::var("RA_WAIT_DBG").is_ok() { #[allow(unused_mut)] let mut d = 4; while d == 4 { diff --git a/docs/dev/debugging.md b/docs/dev/debugging.md index 8c48fd5a1f..cc7a790ff4 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 Ctrl+Shift+P