config: minor fixes

This commit is contained in:
Dmitry Sharshakov 2021-08-23 17:26:12 +03:00
parent 839d210573
commit b6b99b2487
No known key found for this signature in database
GPG key ID: 471FD32E15FD8473
4 changed files with 5 additions and 6 deletions

View file

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

View file

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

View file

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

View file

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