@@ -1,6 +1,6 @@
1−use helix_dap::{events, Client, Payload, Result, SourceBreakpoint};
1+use helix_dap::{events, Client, Event, Payload, Result, SourceBreakpoint};
2use serde::{Deserialize, Serialize};
2use serde::{Deserialize, Serialize};
3−use serde_json::{from_value, to_value};
3+use serde_json::to_value;
4use tokio::sync::mpsc::UnboundedReceiver;
4use tokio::sync::mpsc::UnboundedReceiver;
6#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
6#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
@@ -13,22 +13,19 @@ struct LaunchArguments {
13async fn dispatch(mut rx: UnboundedReceiver<Payload>) {
13async fn dispatch(mut rx: UnboundedReceiver<Payload>) {
15 match rx.recv().await.unwrap() {
15 match rx.recv().await.unwrap() {
16− Payload::Event(ev) => match &ev.event[..] {
16+ Payload::Event(Event::Output(events::Output {
17− "output" => {
17+ category, output, ..
18− let body: events::Output = from_value(ev.body.unwrap()).unwrap();
18+ })) => {
19− println!(
19+ println!(
20− "> [{}] {}",
20+ "> [{}] {}",
21− body.category.unwrap_or("unknown".to_owned()),
21+ category.unwrap_or("unknown".to_owned()),
22− body.output
22+ output
25− "stopped" => {
25+ Payload::Event(Event::Stopped(_)) => {
26− println!("stopped");
26+ println!("stopped");
30− Payload::Response(_) => unreachable!(),
31− Payload::Request(_) => todo!(),