aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-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,
},