From 9712bbb23b19a957aaba9080ec5ee5f3134e526e Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Thu, 24 Feb 2022 11:38:40 +0900 Subject: Use which to resolve lsp/dap binaries This resolves the following issue: https://github.com/helix-editor/helix/discussions/962#discussioncomment-1580046 --- helix-lsp/Cargo.toml | 1 + helix-lsp/src/client.rs | 3 +++ 2 files changed, 4 insertions(+) (limited to 'helix-lsp') 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, id: usize, ) -> Result<(Self, UnboundedReceiver<(usize, Call)>, Arc)> { + // 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()) -- cgit v1.2.3-70-g09d2