Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-dap/src/lib.rs')
| -rw-r--r-- | helix-dap/src/lib.rs | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/helix-dap/src/lib.rs b/helix-dap/src/lib.rs index 4cb95315..b0605c4f 100644 --- a/helix-dap/src/lib.rs +++ b/helix-dap/src/lib.rs @@ -1,9 +1,8 @@ mod client; -pub mod registry; mod transport; mod types; -pub use client::Client; +pub use client::{Client, ConnectionType}; pub use transport::{Payload, Response, Transport}; pub use types::*; @@ -13,7 +12,7 @@ use thiserror::Error; #[derive(Error, Debug)] pub enum Error { #[error("failed to parse: {0}")] - Parse(Box<dyn std::error::Error + Send + Sync>), + Parse(#[from] serde_json::Error), #[error("IO Error: {0}")] IO(#[from] std::io::Error), #[error("request {0} timed out")] @@ -29,22 +28,9 @@ pub enum Error { } pub type Result<T> = core::result::Result<T, Error>; -impl From<serde_json::Error> for Error { - fn from(value: serde_json::Error) -> Self { - Self::Parse(Box::new(value)) - } -} - -impl From<sonic_rs::Error> for Error { - fn from(value: sonic_rs::Error) -> Self { - Self::Parse(Box::new(value)) - } -} - #[derive(Debug)] pub enum Request { RunInTerminal(<requests::RunInTerminal as types::Request>::Arguments), - StartDebugging(<requests::StartDebugging as types::Request>::Arguments), } impl Request { @@ -54,7 +40,6 @@ impl Request { let arguments = arguments.unwrap_or_default(); let request = match command { requests::RunInTerminal::COMMAND => Self::RunInTerminal(parse_value(arguments)?), - requests::StartDebugging::COMMAND => Self::StartDebugging(parse_value(arguments)?), _ => return Err(Error::Unhandled), }; |