diff options
author | Dmitry Sharshakov | 2021-08-12 17:47:14 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-08-20 04:43:54 +0000 |
commit | 0fa127b1051ad9af9371a1c9b424921e4f52d066 (patch) | |
tree | d5d3d0059d77c2cafd0a0edc059321a4065fc38e /helix-dap/examples | |
parent | 7d2d4ed4a86f28bfce8d2fda8a774701d80f5175 (diff) |
dap: support getting scopes and variables
Diffstat (limited to 'helix-dap/examples')
-rw-r--r-- | helix-dap/examples/dap-basic.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/helix-dap/examples/dap-basic.rs b/helix-dap/examples/dap-basic.rs index cc05cd8e..9c4f2f3e 100644 --- a/helix-dap/examples/dap-basic.rs +++ b/helix-dap/examples/dap-basic.rs @@ -28,7 +28,7 @@ pub async fn main() -> Result<()> { .set_breakpoints( "/tmp/godebug/main.go".to_owned(), vec![SourceBreakpoint { - line: 6, + line: 8, column: Some(2), }] ) @@ -43,7 +43,17 @@ pub async fn main() -> Result<()> { println!("configurationDone: {:?}", client.configuration_done().await); println!("stopped: {:?}", client.wait_for_stopped().await); println!("threads: {:#?}", client.threads().await); - println!("stack trace: {:#?}", client.stack_trace(1).await); + let bt = client.stack_trace(1).await.expect("expected stack trace"); + println!("stack trace: {:#?}", bt); + let scopes = client + .scopes(bt.0[0].id) + .await + .expect("expected scopes for thread"); + println!("scopes: {:#?}", scopes); + println!( + "vars: {:#?}", + client.variables(scopes[1].variables_reference).await + ); let mut _in = String::new(); std::io::stdin() |