aboutsummaryrefslogtreecommitdiff
path: root/helix-dap
diff options
context:
space:
mode:
authorBlaž Hrastnik2022-02-24 02:38:40 +0000
committerBlaž Hrastnik2022-02-24 02:38:40 +0000
commit9712bbb23b19a957aaba9080ec5ee5f3134e526e (patch)
tree1c0e76ce980651f4690d325f922786347c42cc89 /helix-dap
parent45262161392fde814cf0da54d268d8f75366a4ee (diff)
Use which to resolve lsp/dap binaries
This resolves the following issue: https://github.com/helix-editor/helix/discussions/962#discussioncomment-1580046
Diffstat (limited to 'helix-dap')
-rw-r--r--helix-dap/Cargo.toml1
-rw-r--r--helix-dap/src/client.rs3
2 files changed, 4 insertions, 0 deletions
diff --git a/helix-dap/Cargo.toml b/helix-dap/Cargo.toml
index 24288697..95a05905 100644
--- a/helix-dap/Cargo.toml
+++ b/helix-dap/Cargo.toml
@@ -19,6 +19,7 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "1.0"
tokio = { version = "1", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot", "net", "sync"] }
+which = "4.2"
[dev-dependencies]
fern = "0.6"
diff --git a/helix-dap/src/client.rs b/helix-dap/src/client.rs
index 56254429..9498c64c 100644
--- a/helix-dap/src/client.rs
+++ b/helix-dap/src/client.rs
@@ -105,6 +105,9 @@ impl Client {
args: Vec<&str>,
id: usize,
) -> Result<(Self, UnboundedReceiver<Payload>)> {
+ // Resolve path to the binary
+ let cmd = which::which(cmd).map_err(|err| anyhow::anyhow!(err))?;
+
let process = Command::new(cmd)
.args(args)
.stdin(Stdio::piped())