From 6c0f7eafc34d54cc4d4883908741b6f33a7372dd Mon Sep 17 00:00:00 2001 From: Dmitry Sharshakov Date: Sun, 15 Aug 2021 10:14:11 +0300 Subject: [PATCH] examples: continue handling output events --- helix-dap/examples/dap-dlv.rs | 16 +++++++++------- 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 cb920e32e..c42559b99 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) { - 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 97d842ab7..6fe666b21 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) { - 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]