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>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub debug_adapter: Option<DebugAdapterConfig>,
// TODO: names for those
#[serde(skip_serializing_if = "Option::is_none")]
pub debug_configs: Option<Vec<HashMap<String, serde_json::Value>>>,
}

@ -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<String>,

@ -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

@ -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 = "."

Loading…
Cancel
Save