diff options
author | Blaž Hrastnik | 2021-08-22 07:05:12 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-08-22 07:05:12 +0000 |
commit | 28658836eee9860666a114756e13e1fdf7fd4637 (patch) | |
tree | f999c4b756014d69caf0b485fd16403c200e2c4c /helix-dap/src/transport.rs | |
parent | 2aee5f02d0c32dd72cde2b28f2f2dbe17bafce46 (diff) |
Add more event types, simplify event decoding
Diffstat (limited to 'helix-dap/src/transport.rs')
-rw-r--r-- | helix-dap/src/transport.rs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/helix-dap/src/transport.rs b/helix-dap/src/transport.rs index 062e0447..afb7694d 100644 --- a/helix-dap/src/transport.rs +++ b/helix-dap/src/transport.rs @@ -1,4 +1,4 @@ -use crate::{Error, Result}; +use crate::{Error, Event, Result}; use anyhow::Context; use log::{error, info, warn}; use serde::{Deserialize, Serialize}; @@ -32,13 +32,6 @@ pub struct Response { pub body: Option<Value>, } -#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)] -pub struct Event { - // seq is omitted as unused and is not sent by some implementations - pub event: String, - pub body: Option<Value>, -} - #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(tag = "type", rename_all = "camelCase")] pub enum Payload { @@ -208,8 +201,8 @@ impl Transport { client_tx.send(msg).expect("Failed to send"); Ok(()) } - Payload::Event(Event { ref event, .. }) => { - info!("<- DAP event {}", event); + Payload::Event(ref event) => { + info!("<- DAP event {:?}", event); client_tx.send(msg).expect("Failed to send"); Ok(()) } |