From a54b09e3fe6eaf72ab7a4f3664efc0b8b7cf13fd Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Fri, 20 Aug 2021 14:06:55 +0900 Subject: dap: Split out launch from init --- helix-dap/src/client.rs | 2 +- helix-dap/src/types.rs | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'helix-dap') diff --git a/helix-dap/src/client.rs b/helix-dap/src/client.rs index 84704b96..e7e714b6 100644 --- a/helix-dap/src/client.rs +++ b/helix-dap/src/client.rs @@ -265,7 +265,7 @@ impl Client { pub async fn set_breakpoints( &mut self, - file: String, + file: PathBuf, breakpoints: Vec, ) -> Result>> { let args = requests::SetBreakpointsArguments { diff --git a/helix-dap/src/types.rs b/helix-dap/src/types.rs index d85b05c0..3fd858de 100644 --- a/helix-dap/src/types.rs +++ b/helix-dap/src/types.rs @@ -1,5 +1,6 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; +use std::path::PathBuf; pub trait Request { type Arguments: serde::de::DeserializeOwned + serde::Serialize; @@ -91,7 +92,7 @@ pub struct Checksum { #[serde(rename_all = "camelCase")] pub struct Source { pub name: Option, - pub path: Option, + pub path: Option, pub source_reference: Option, pub presentation_hint: Option, pub origin: Option, @@ -207,7 +208,7 @@ pub struct Variable { pub mod requests { use super::*; - #[derive(Debug, PartialEq, Clone, Deserialize, Serialize)] + #[derive(Debug, Default, PartialEq, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct InitializeArguments { #[serde(rename = "clientID")] @@ -274,7 +275,7 @@ pub mod requests { const COMMAND: &'static str = "configurationDone"; } - #[derive(Debug, PartialEq, Clone, Deserialize, Serialize)] + #[derive(Debug, Default, PartialEq, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct SetBreakpointsArguments { pub source: Source, @@ -283,7 +284,7 @@ pub mod requests { pub source_modified: Option, } - #[derive(Debug, PartialEq, Clone, Deserialize, Serialize)] + #[derive(Debug, Default, PartialEq, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct SetBreakpointsResponse { pub breakpoints: Option>, @@ -298,7 +299,7 @@ pub mod requests { const COMMAND: &'static str = "setBreakpoints"; } - #[derive(Debug, PartialEq, Clone, Deserialize, Serialize)] + #[derive(Debug, Default, PartialEq, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct ContinueArguments { pub thread_id: usize, @@ -319,7 +320,7 @@ pub mod requests { const COMMAND: &'static str = "continue"; } - #[derive(Debug, PartialEq, Clone, Deserialize, Serialize)] + #[derive(Debug, Default, PartialEq, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct StackTraceArguments { pub thread_id: usize, @@ -380,7 +381,7 @@ pub mod requests { const COMMAND: &'static str = "scopes"; } - #[derive(Debug, PartialEq, Clone, Deserialize, Serialize)] + #[derive(Debug, Default, PartialEq, Clone, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct VariablesArguments { pub variables_reference: usize, -- cgit v1.2.3-70-g09d2