aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarrOff <58253563+BarrOff@users.noreply.github.com>2024-02-25 06:41:44 +0000
committerGitHub <noreply@github.com>2024-02-25 14:41:44 +0800
commit60c3bd33d878dae2a8650b11b178cdb48fdd7309 (patch)
tree92fb2b29ed742c62c2148996f72b4582ab1f91fa
parentdocs: update server_configurations.md (diff)
downloadnvim-lspconfig-60c3bd33d878dae2a8650b11b178cdb48fdd7309.tar
nvim-lspconfig-60c3bd33d878dae2a8650b11b178cdb48fdd7309.tar.gz
nvim-lspconfig-60c3bd33d878dae2a8650b11b178cdb48fdd7309.tar.bz2
nvim-lspconfig-60c3bd33d878dae2a8650b11b178cdb48fdd7309.tar.lz
nvim-lspconfig-60c3bd33d878dae2a8650b11b178cdb48fdd7309.tar.xz
nvim-lspconfig-60c3bd33d878dae2a8650b11b178cdb48fdd7309.tar.zst
nvim-lspconfig-60c3bd33d878dae2a8650b11b178cdb48fdd7309.zip
fix(bqnlsp): do not override user provided `cmd_env` (#3026)
-rw-r--r--lua/lspconfig/server_configurations/bqnlsp.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/lua/lspconfig/server_configurations/bqnlsp.lua b/lua/lspconfig/server_configurations/bqnlsp.lua
index 88aea6b9..5d18e996 100644
--- a/lua/lspconfig/server_configurations/bqnlsp.lua
+++ b/lua/lspconfig/server_configurations/bqnlsp.lua
@@ -1,13 +1,15 @@
local util = require 'lspconfig.util'
-- set os dependent library path
-local function library_path(path)
+local function library_path(path, cmd_env)
path = path or '/usr/local/lib'
- if vim.fn.has 'macunix' then
- return { DYLD_LIBRARY_PATH = path }
- elseif vim.fn.has 'linux' then
- return { LD_LIBRARY_PATH = path }
+ cmd_env = cmd_env or {}
+ if vim.fn.has 'macunix' and not cmd_env.DYLD_LIBRARY_PATH then
+ cmd_env.DYLD_LIBRARY_PATH = path
+ elseif vim.fn.has 'linux' and not cmd_env.LD_LIBRARY_PATH then
+ cmd_env.LD_LIBRARY_PATH = path
end
+ return cmd_env
end
return {
@@ -19,7 +21,7 @@ return {
libcbqnPath = nil,
on_new_config = function(new_config, _)
if new_config.libcbqnPath then
- new_config.cmd_env = library_path(new_config.libcbqnPath)
+ new_config.cmd_env = library_path(new_config.libcbqnPath, new_config.cmd_env)
end
end,
},