From 413e477dc2d4792596f99979140d2879ec3d4f4f Mon Sep 17 00:00:00 2001 From: Dmitry Sharshakov Date: Mon, 6 Sep 2021 13:49:31 +0300 Subject: [PATCH] lldb: use stdio transport by default --- helix-core/src/syntax.rs | 1 + helix-dap/src/client.rs | 8 ++++++-- languages.toml | 12 +++--------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index cabfe083a..bbee921b2 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -98,6 +98,7 @@ pub struct DebugAdapterConfig { pub name: String, pub transport: String, pub command: String, + #[serde(default)] pub args: Vec, pub port_arg: Option, pub templates: Vec, diff --git a/helix-dap/src/client.rs b/helix-dap/src/client.rs index e5f8feb9a..2ae824225 100644 --- a/helix-dap/src/client.rs +++ b/helix-dap/src/client.rs @@ -116,12 +116,16 @@ impl Client { // TODO: do we need bufreader/writer here? or do we use async wrappers on unblock? let writer = BufWriter::new(process.stdin.take().expect("Failed to open stdin")); let reader = BufReader::new(process.stdout.take().expect("Failed to open stdout")); - let errors = BufReader::new(process.stderr.take().expect("Failed to open stderr")); + let errors = process.stderr.take().map(BufReader::new); Self::streams( Box::new(BufReader::new(reader)), Box::new(writer), - Some(Box::new(BufReader::new(errors))), + // errors.map(|errors| Box::new(BufReader::new(errors))), + match errors { + Some(errors) => Some(Box::new(BufReader::new(errors))), + None => None, + }, id, Some(process), ) diff --git a/languages.toml b/languages.toml index 1a557943c..6ec5302da 100644 --- a/languages.toml +++ b/languages.toml @@ -22,10 +22,8 @@ indent = { tab-width = 4, unit = " " } [language.debugger] name = "lldb-vscode" -transport = "tcp" +transport = "stdio" command = "lldb-vscode" -args = [] -port-arg = "-p {}" [[language.debugger.templates]] name = "binary" @@ -91,10 +89,8 @@ indent = { tab-width = 2, unit = " " } [language.debugger] name = "lldb-vscode" -transport = "tcp" +transport = "stdio" command = "lldb-vscode" -args = [] -port-arg = "-p {}" [[language.debugger.templates]] name = "binary" @@ -121,10 +117,8 @@ indent = { tab-width = 2, unit = " " } [language.debugger] name = "lldb-vscode" -transport = "tcp" +transport = "stdio" command = "lldb-vscode" -args = [] -port-arg = "-p {}" [[language.debugger.templates]] name = "binary"