aboutsummaryrefslogtreecommitdiff
path: root/helix-dap
diff options
context:
space:
mode:
authorDmitry Sharshakov2021-09-26 07:24:58 +0000
committerDmitry Sharshakov2021-09-26 07:24:58 +0000
commit0e51e5fbaf6eeffa25b8660b96f2486174671492 (patch)
treea76212d795705f3af039ff6de409bf5ec98be856 /helix-dap
parentbf53aff27d2d90b41bab01f4d628f0bd9fbcd589 (diff)
editor: support setExceptionBreakpoints
Diffstat (limited to 'helix-dap')
-rw-r--r--helix-dap/src/client.rs13
-rw-r--r--helix-dap/src/types.rs23
2 files changed, 36 insertions, 0 deletions
diff --git a/helix-dap/src/client.rs b/helix-dap/src/client.rs
index 2ae82422..8dd41868 100644
--- a/helix-dap/src/client.rs
+++ b/helix-dap/src/client.rs
@@ -399,4 +399,17 @@ impl Client {
self.request::<requests::Evaluate>(args).await
}
+
+ pub async fn set_exception_breakpoints(
+ &mut self,
+ filters: Vec<String>,
+ ) -> Result<Option<Vec<Breakpoint>>> {
+ let args = requests::SetExceptionBreakpointsArguments { filters };
+
+ let response = self
+ .request::<requests::SetExceptionBreakpoints>(args)
+ .await;
+
+ Ok(response.ok().map(|r| r.breakpoints).unwrap_or_default())
+ }
}
diff --git a/helix-dap/src/types.rs b/helix-dap/src/types.rs
index 3af29922..5430771f 100644
--- a/helix-dap/src/types.rs
+++ b/helix-dap/src/types.rs
@@ -515,6 +515,29 @@ pub mod requests {
type Result = EvaluateResponse;
const COMMAND: &'static str = "evaluate";
}
+
+ #[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
+ #[serde(rename_all = "camelCase")]
+ pub struct SetExceptionBreakpointsArguments {
+ pub filters: Vec<String>,
+ // pub filterOptions: Option<Vec<ExceptionFilterOptions>>, // needs capability
+ // pub exceptionOptions: Option<Vec<ExceptionOptions>>, // needs capability
+ }
+
+ #[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
+ #[serde(rename_all = "camelCase")]
+ pub struct SetExceptionBreakpointsResponse {
+ pub breakpoints: Option<Vec<Breakpoint>>,
+ }
+
+ #[derive(Debug)]
+ pub enum SetExceptionBreakpoints {}
+
+ impl Request for SetExceptionBreakpoints {
+ type Arguments = SetExceptionBreakpointsArguments;
+ type Result = SetExceptionBreakpointsResponse;
+ const COMMAND: &'static str = "setExceptionBreakpoints";
+ }
}
// Events