From 299da5a35b1917812a0f37e046d946031474d606 Mon Sep 17 00:00:00 2001 From: Dmitry Sharshakov Date: Tue, 24 Aug 2021 20:27:54 +0300 Subject: [PATCH] Support attach request --- helix-term/src/commands.rs | 9 +++++++-- languages.toml | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 7d3fafe60..0a8fb99b0 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -24,6 +24,7 @@ }; use insert::*; use movement::Movement; +use serde_json::Value; use crate::{ compositor::{self, Component, Compositor}, @@ -4454,7 +4455,7 @@ fn dap_start_impl(editor: &mut Editor, name: Option<&str>, params: Option = HashMap::new(); if let Some(params) = params { for (k, t) in template { @@ -4464,7 +4465,11 @@ fn dap_start_impl(editor: &mut Editor, name: Option<&str>, params: Option() { + args.insert(k, Value::Number(serde_json::Number::from(integer))); + } else { + args.insert(k, Value::String(value)); + } } } diff --git a/languages.toml b/languages.toml index 291202c1c..83d45e34d 100644 --- a/languages.toml +++ b/languages.toml @@ -32,6 +32,11 @@ name = "binary" request = "launch" args = { console = "internalConsole", program = "{0}" } +[[language.debugger.templates]] +name = "attach" +request = "attach" +args = { console = "internalConsole", pid = "{0}" } + [[language]] name = "toml" scope = "source.toml" @@ -94,6 +99,11 @@ name = "binary" request = "launch" args = { console = "internalConsole", program = "main" } +[[language.debugger.templates]] +name = "attach" +request = "attach" +args = { console = "internalConsole", pid = "{0}" } + [[language]] name = "cpp" scope = "source.cpp" @@ -117,6 +127,11 @@ name = "binary" request = "launch" args = { console = "internalConsole", program = "main" } +[[language.debugger.templates]] +name = "attach" +request = "attach" +args = { console = "internalConsole", pid = "{0}" } + [[language]] name = "go" scope = "source.go" @@ -152,6 +167,11 @@ name = "test" request = "launch" args = { mode = "test", program = "{0}" } +[[language.debugger.templates]] +name = "attach" +request = "attach" +args = { mode = "local", processId = "{0}" } + [[language]] name = "javascript" scope = "source.js"