config: minor fixes

pull/574/head
Dmitry Sharshakov 3 years ago
parent 839d210573
commit b6b99b2487
No known key found for this signature in database
GPG Key ID: 471FD32E15FD8473

@ -58,6 +58,7 @@ pub struct LanguageConfiguration {
pub(crate) indent_query: OnceCell<Option<IndentQuery>>, pub(crate) indent_query: OnceCell<Option<IndentQuery>>,
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub debug_adapter: Option<DebugAdapterConfig>, pub debug_adapter: Option<DebugAdapterConfig>,
// TODO: names for those
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub debug_configs: Option<Vec<HashMap<String, serde_json::Value>>>, pub debug_configs: Option<Vec<HashMap<String, serde_json::Value>>>,
} }

@ -5,6 +5,7 @@ use std::path::PathBuf;
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)] #[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "kebab-case")]
pub struct DebugAdapterConfig { pub struct DebugAdapterConfig {
pub name: String,
pub transport: String, pub transport: String,
pub command: String, pub command: String,
pub args: Vec<String>, pub args: Vec<String>,

@ -4362,10 +4362,10 @@ fn dap_start(cx: &mut Context) {
return; return;
} }
}; };
let started = Client::process(config, 0); let started = Client::process(config.clone(), 0);
let (mut debugger, events) = block_on(started).unwrap(); 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 _ = block_on(request).unwrap();
let sessions = cx let sessions = cx

@ -93,20 +93,17 @@ comment-token = "//"
language-server = { command = "gopls" } language-server = { command = "gopls" }
# TODO: gopls needs utf-8 offsets? # TODO: gopls needs utf-8 offsets?
indent = { tab-width = 4, unit = "\t" } 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]] [[language.debug-configs]]
request = "launch"
mode = "debug" mode = "debug"
program = "main.go" program = "main.go"
[[language.debug-configs]] [[language.debug-configs]]
request = "launch"
mode = "exec" mode = "exec"
program = "main" program = "main"
[[language.debug-configs]] [[language.debug-configs]]
request = "launch"
mode = "test" mode = "test"
program = "." program = "."

Loading…
Cancel
Save