summaryrefslogtreecommitdiff
path: root/helix-dap/src
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-08-20 05:06:55 +0000
committerBlaž Hrastnik2021-08-20 05:06:55 +0000
commita54b09e3fe6eaf72ab7a4f3664efc0b8b7cf13fd (patch)
treed64c38f4c9d79b11e24dbf5eb89a72111f11903b /helix-dap/src
parent94a1951d40d26f4f535bdb5aab5668c84fdd95ae (diff)
dap: Split out launch from init
Diffstat (limited to 'helix-dap/src')
-rw-r--r--helix-dap/src/client.rs2
-rw-r--r--helix-dap/src/types.rs15
2 files changed, 9 insertions, 8 deletions
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<SourceBreakpoint>,
) -> Result<Option<Vec<Breakpoint>>> {
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<String>,
- pub path: Option<String>,
+ pub path: Option<PathBuf>,
pub source_reference: Option<usize>,
pub presentation_hint: Option<String>,
pub origin: Option<String>,
@@ -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<bool>,
}
- #[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
+ #[derive(Debug, Default, PartialEq, Clone, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SetBreakpointsResponse {
pub breakpoints: Option<Vec<Breakpoint>>,
@@ -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,