From c463142e5e43fa83fc5f8f714af72425d18ba216 Mon Sep 17 00:00:00 2001 From: Dmitry Sharshakov Date: Tue, 24 Aug 2021 11:56:18 +0300 Subject: Create new debugger config format --- helix-dap/src/client.rs | 4 +++- helix-dap/src/types.rs | 11 ++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'helix-dap/src') 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 +} #[derive(Debug, PartialEq, Clone, Deserialize, Serialize)] #[serde(rename_all = "kebab-case")] @@ -10,6 +18,7 @@ pub struct DebugAdapterConfig { pub command: String, pub args: Vec, pub port_arg: Option, + pub templates: Vec, } pub trait Request { -- cgit v1.2.3-70-g09d2