From 0fa127b1051ad9af9371a1c9b424921e4f52d066 Mon Sep 17 00:00:00 2001 From: Dmitry Sharshakov Date: Thu, 12 Aug 2021 20:47:14 +0300 Subject: dap: support getting scopes and variables --- helix-dap/examples/dap-basic.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'helix-dap/examples') 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() -- cgit v1.2.3-70-g09d2