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-dap/Cargo.toml | 1 + helix-dap/src/client.rs | 3 +++ 2 files changed, 4 insertions(+) (limited to 'helix-dap') 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)> { + // 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