From 16e13b9789359282cb6c2681262f46fb1b70134b Mon Sep 17 00:00:00 2001 From: TotalKrill Date: Fri, 9 Dec 2022 05:09:23 +0100 Subject: allow specifying environment for language servers in language.toml (#4004) Signed-off-by: Stephen Wakely Co-authored-by: Stephen Wakely Co-authored-by: Blaž Hrastnik --- helix-lsp/src/client.rs | 3 +++ helix-lsp/src/lib.rs | 1 + 2 files changed, 4 insertions(+) (limited to 'helix-lsp/src') diff --git a/helix-lsp/src/client.rs b/helix-lsp/src/client.rs index 90fd2f21..dd2581c6 100644 --- a/helix-lsp/src/client.rs +++ b/helix-lsp/src/client.rs @@ -42,10 +42,12 @@ pub struct Client { impl Client { #[allow(clippy::type_complexity)] + #[allow(clippy::too_many_arguments)] pub fn start( cmd: &str, args: &[String], config: Option, + server_environment: HashMap, root_markers: &[String], id: usize, req_timeout: u64, @@ -55,6 +57,7 @@ impl Client { let cmd = which::which(cmd).map_err(|err| anyhow::anyhow!(err))?; let process = Command::new(cmd) + .envs(server_environment) .args(args) .stdin(Stdio::piped()) .stdout(Stdio::piped()) diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs index f714395f..8418896c 100644 --- a/helix-lsp/src/lib.rs +++ b/helix-lsp/src/lib.rs @@ -550,6 +550,7 @@ fn start_client( &ls_config.command, &ls_config.args, config.config.clone(), + ls_config.environment.clone(), &config.roots, id, ls_config.timeout, -- cgit v1.2.3-70-g09d2