diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index cfe5f5a11..ee7aa0ebd 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -58,6 +58,7 @@ pub struct LanguageConfiguration { pub(crate) indent_query: OnceCell>, #[serde(skip_serializing_if = "Option::is_none")] pub debug_adapter: Option, + // TODO: names for those #[serde(skip_serializing_if = "Option::is_none")] pub debug_configs: Option>>, } diff --git a/helix-dap/src/types.rs b/helix-dap/src/types.rs index a31bc1d14..fde3cd80a 100644 --- a/helix-dap/src/types.rs +++ b/helix-dap/src/types.rs @@ -5,6 +5,7 @@ use std::path::PathBuf; #[derive(Debug, PartialEq, Clone, Deserialize, Serialize)] #[serde(rename_all = "kebab-case")] pub struct DebugAdapterConfig { + pub name: String, pub transport: String, pub command: String, pub args: Vec, diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 749b8820b..c10f94e6c 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -4362,10 +4362,10 @@ fn dap_start(cx: &mut Context) { return; } }; - let started = Client::process(config, 0); + let started = Client::process(config.clone(), 0); let (mut debugger, events) = block_on(started).unwrap(); - let request = debugger.initialize("go".to_owned()); + let request = debugger.initialize(config.name); let _ = block_on(request).unwrap(); let sessions = cx diff --git a/languages.toml b/languages.toml index 95d0b1772..8f8eb1c14 100644 --- a/languages.toml +++ b/languages.toml @@ -93,20 +93,17 @@ comment-token = "//" language-server = { command = "gopls" } # TODO: gopls needs utf-8 offsets? indent = { tab-width = 4, unit = "\t" } -debug-adapter = { transport = "tcp", command = "dlv", args = ["dap"], port-arg = "-l 127.0.0.1:{}" } +debug-adapter = { name = "go", transport = "tcp", command = "dlv", args = ["dap"], port-arg = "-l 127.0.0.1:{}" } [[language.debug-configs]] -request = "launch" mode = "debug" program = "main.go" [[language.debug-configs]] -request = "launch" mode = "exec" program = "main" [[language.debug-configs]] -request = "launch" mode = "test" program = "."