aboutsummaryrefslogtreecommitdiff
path: root/helix-dap
diff options
context:
space:
mode:
authorDmitry Sharshakov2021-08-24 08:56:18 +0000
committerDmitry Sharshakov2021-08-24 08:56:18 +0000
commitc463142e5e43fa83fc5f8f714af72425d18ba216 (patch)
treef369a44f3ef4b1569d5fc414078d0d6c1c6846b9 /helix-dap
parent34c6094604cfeca0c1338a20cf9e85bcd8d9b68b (diff)
Create new debugger config format
Diffstat (limited to 'helix-dap')
-rw-r--r--helix-dap/src/client.rs4
-rw-r--r--helix-dap/src/types.rs11
2 files changed, 13 insertions, 2 deletions
diff --git a/helix-dap/src/client.rs b/helix-dap/src/client.rs
index ed4f8ed5..43afc4c6 100644
--- a/helix-dap/src/client.rs
+++ b/helix-dap/src/client.rs
@@ -225,7 +225,9 @@ impl Client {
}
pub fn capabilities(&self) -> &DebuggerCapabilities {
- self.caps.as_ref().expect("debugger not yet initialized!")
+ self.caps
+ .as_ref()
+ .expect("debugger not yet initialized!")
}
pub async fn initialize(&mut self, adapter_id: String) -> Result<()> {
diff --git a/helix-dap/src/types.rs b/helix-dap/src/types.rs
index 390fa7f3..e8543dcb 100644
--- a/helix-dap/src/types.rs
+++ b/helix-dap/src/types.rs
@@ -1,6 +1,14 @@
use serde::{Deserialize, Serialize};
use serde_json::Value;
-use std::path::PathBuf;
+use std::{collections::HashMap, path::PathBuf};
+
+#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
+#[serde(rename_all = "kebab-case")]
+pub struct DebugTemplate {
+ pub name: String,
+ pub request: String,
+ pub args: HashMap<String, Value>
+}
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")]
@@ -10,6 +18,7 @@ pub struct DebugAdapterConfig {
pub command: String,
pub args: Vec<String>,
pub port_arg: Option<String>,
+ pub templates: Vec<DebugTemplate>,
}
pub trait Request {