on master help sign in
config: minor fixes
b6b99b2Dmitry Sharshakov
helix-core/src/syntax.rs+1
@@ -58,6 +58,7 @@ pub struct LanguageConfiguration {
58 pub(crate) indent_query: OnceCell<Option<IndentQuery>>,
58 pub(crate) indent_query: OnceCell<Option<IndentQuery>>,
59 #[serde(skip_serializing_if = "Option::is_none")]
59 #[serde(skip_serializing_if = "Option::is_none")]
60 pub debug_adapter: Option<DebugAdapterConfig>,
60 pub debug_adapter: Option<DebugAdapterConfig>,
61+ // TODO: names for those
61 #[serde(skip_serializing_if = "Option::is_none")]
62 #[serde(skip_serializing_if = "Option::is_none")]
62 pub debug_configs: Option<Vec<HashMap<String, serde_json::Value>>>,
63 pub debug_configs: Option<Vec<HashMap<String, serde_json::Value>>>,
63}
64}
helix-dap/src/types.rs+1
@@ -5,6 +5,7 @@ use std::path::PathBuf;
5#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
5#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
6#[serde(rename_all = "kebab-case")]
6#[serde(rename_all = "kebab-case")]
7pub struct DebugAdapterConfig {
7pub struct DebugAdapterConfig {
8+ pub name: String,
8 pub transport: String,
9 pub transport: String,
9 pub command: String,
10 pub command: String,
10 pub args: Vec<String>,
11 pub args: Vec<String>,
helix-term/src/commands.rs+2−2
@@ -4362,10 +4362,10 @@ fn dap_start(cx: &mut Context) {
4362 return;
4362 return;
4363 }
4363 }
4364 };
4364 };
4365− let started = Client::process(config, 0);
4365+ let started = Client::process(config.clone(), 0);
4366 let (mut debugger, events) = block_on(started).unwrap();
4366 let (mut debugger, events) = block_on(started).unwrap();
4367
4367
4368− let request = debugger.initialize("go".to_owned());
4368+ let request = debugger.initialize(config.name);
4369 let _ = block_on(request).unwrap();
4369 let _ = block_on(request).unwrap();
4370
4370
4371 let sessions = cx
4371 let sessions = cx
languages.toml+1−4
@@ -93,20 +93,17 @@ comment-token = "//"
93language-server = { command = "gopls" }
93language-server = { command = "gopls" }
94# TODO: gopls needs utf-8 offsets?
94# TODO: gopls needs utf-8 offsets?
95indent = { tab-width = 4, unit = "\t" }
95indent = { tab-width = 4, unit = "\t" }
96−debug-adapter = { transport = "tcp", command = "dlv", args = ["dap"], port-arg = "-l 127.0.0.1:{}" }
96+debug-adapter = { name = "go", transport = "tcp", command = "dlv", args = ["dap"], port-arg = "-l 127.0.0.1:{}" }
97
97
98[[language.debug-configs]]
98[[language.debug-configs]]
99−request = "launch"
100mode = "debug"
99mode = "debug"
101program = "main.go"
100program = "main.go"
102
101
103[[language.debug-configs]]
102[[language.debug-configs]]
104−request = "launch"
105mode = "exec"
103mode = "exec"
106program = "main"
104program = "main"
107
105
108[[language.debug-configs]]
106[[language.debug-configs]]
109−request = "launch"
110mode = "test"
107mode = "test"
111program = "."
108program = "."
112
109