aboutsummaryrefslogtreecommitdiff
path: root/helix-dap/examples/dap-basic.rs
diff options
context:
space:
mode:
authorDmitry Sharshakov2021-08-14 06:25:44 +0000
committerBlaž Hrastnik2021-08-20 04:43:54 +0000
commitb3be6b269aaf8b81d74ca4f0001254d8a17a6c76 (patch)
tree9fd7ca01b3592163806ff9a27fdc0eae140598fd /helix-dap/examples/dap-basic.rs
parent0777948fc03f9edeec33d13175d6631331409e9c (diff)
dap-basic: parse stop event
Diffstat (limited to 'helix-dap/examples/dap-basic.rs')
-rw-r--r--helix-dap/examples/dap-basic.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/helix-dap/examples/dap-basic.rs b/helix-dap/examples/dap-basic.rs
index 3331c6bb..eef64be3 100644
--- a/helix-dap/examples/dap-basic.rs
+++ b/helix-dap/examples/dap-basic.rs
@@ -1,4 +1,4 @@
-use helix_dap::{Client, Event, OutputEventBody, Result, SourceBreakpoint};
+use helix_dap::{Client, Event, OutputEventBody, Result, SourceBreakpoint, StoppedEventBody};
use serde::{Deserialize, Serialize};
use serde_json::from_value;
use tokio::sync::mpsc::Receiver;
@@ -75,7 +75,9 @@ pub async fn main() -> Result<()> {
println!("configurationDone: {:?}", client.configuration_done().await);
- println!("stopped: {:?}", stopped_event.recv().await);
+ let stop: StoppedEventBody =
+ from_value(stopped_event.recv().await.unwrap().body.unwrap()).unwrap();
+ println!("stopped: {:?}", stop);
println!("threads: {:#?}", client.threads().await);
let bt = client.stack_trace(1).await.expect("expected stack trace");