aboutsummaryrefslogtreecommitdiff
path: root/helix-lsp
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-lsp
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-lsp')
-rw-r--r--helix-lsp/Cargo.toml1
-rw-r--r--helix-lsp/src/client.rs3
2 files changed, 4 insertions, 0 deletions
diff --git a/helix-lsp/Cargo.toml b/helix-lsp/Cargo.toml
index 1a704125..755f49b5 100644
--- a/helix-lsp/Cargo.toml
+++ b/helix-lsp/Cargo.toml
@@ -25,3 +25,4 @@ serde_json = "1.0"
thiserror = "1.0"
tokio = { version = "1.17", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot", "sync"] }
tokio-stream = "0.1.8"
+which = "4.2"
diff --git a/helix-lsp/src/client.rs b/helix-lsp/src/client.rs
index 15cbca0e..362498cb 100644
--- a/helix-lsp/src/client.rs
+++ b/helix-lsp/src/client.rs
@@ -43,6 +43,9 @@ impl Client {
root_markers: Vec<String>,
id: usize,
) -> Result<(Self, UnboundedReceiver<(usize, Call)>, Arc<Notify>)> {
+ // 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())