diff options
author | Dmitry Sharshakov | 2021-08-15 07:14:11 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-08-20 04:43:54 +0000 |
commit | 6c0f7eafc34d54cc4d4883908741b6f33a7372dd (patch) | |
tree | f8fd43e6572683f517c7ac30573eb008c0423393 /helix-dap | |
parent | 279db98d3cb6c7ee41af81c3e8eb6ef69a1662d0 (diff) |
examples: continue handling output events
Diffstat (limited to 'helix-dap')
-rw-r--r-- | helix-dap/examples/dap-dlv.rs | 16 | ||||
-rw-r--r-- | helix-dap/examples/dap-lldb.rs | 16 |
2 files changed, 18 insertions, 14 deletions
diff --git a/helix-dap/examples/dap-dlv.rs b/helix-dap/examples/dap-dlv.rs index cb920e32..c42559b9 100644 --- a/helix-dap/examples/dap-dlv.rs +++ b/helix-dap/examples/dap-dlv.rs @@ -11,13 +11,15 @@ struct LaunchArguments { } async fn output(mut output_event: Receiver<Event>) { - let body: OutputEventBody = - from_value(output_event.recv().await.unwrap().body.unwrap()).unwrap(); - println!( - "> [{}] {}", - body.category.unwrap_or("unknown".to_owned()), - body.output - ); + loop { + let body: OutputEventBody = + from_value(output_event.recv().await.unwrap().body.unwrap()).unwrap(); + println!( + "> [{}] {}", + body.category.unwrap_or("unknown".to_owned()), + body.output + ); + } } #[tokio::main] diff --git a/helix-dap/examples/dap-lldb.rs b/helix-dap/examples/dap-lldb.rs index 97d842ab..6fe666b2 100644 --- a/helix-dap/examples/dap-lldb.rs +++ b/helix-dap/examples/dap-lldb.rs @@ -11,13 +11,15 @@ struct LaunchArguments { } async fn output(mut output_event: Receiver<Event>) { - let body: OutputEventBody = - from_value(output_event.recv().await.unwrap().body.unwrap()).unwrap(); - println!( - "> [{}] {}", - body.category.unwrap_or("unknown".to_owned()), - body.output - ); + loop { + let body: OutputEventBody = + from_value(output_event.recv().await.unwrap().body.unwrap()).unwrap(); + println!( + "> [{}] {}", + body.category.unwrap_or("unknown".to_owned()), + body.output + ); + } } #[tokio::main] |