allow system bash-language-server

This commit is contained in:
sgraves committed 2026-11-03 19:06:08 +00:00
1 parent 800d60a312
commit 67539072a5
3 files changed
+30 -4

No files matched your search

+22 -3
View File
@@ -24,10 +24,25 @@ end
---@diagnostic disable-next-line: deprecated
local unpacker = table.unpack or unpack
-- Servers whose binaries are installed on the system (not managed by mason).
-- mason-lspconfig's automatic_enable only enables servers whose mason package
-- is installed, so these must be excluded there and enabled explicitly below.
local system_installed = {"vala_ls"}
-- When using the system-installed bash-language-server (Dockerfile.extra),
-- bashls must be enabled explicitly rather than via mason.
if NV_DARCULA_USE_SYSTEM_BASH_LS then
table.insert(system_installed, "bashls")
end
-- Exclude servers that are not managed by mason (e.g., system-installed)
local mason_lsp_auto_enable = vim.tbl_filter(function(name)
return not vim.tbl_contains({"vala_ls"}, name)
end, NV_DARCULA_MASON_LSP_LIST)
local mason_lsp_auto_enable =
vim.tbl_filter(
function(name)
return not vim.tbl_contains(system_installed, name)
end,
NV_DARCULA_MASON_LSP_LIST
)
require("mason-lspconfig").setup {
automatic_enable = mason_lsp_auto_enable
@@ -148,6 +163,10 @@ for _, name in pairs(NV_DARCULA_MASON_LSP_LIST) do
}
}
)
elseif name == "bashls" and NV_DARCULA_USE_SYSTEM_BASH_LS then
-- system-installed (Dockerfile.extra); mason does not manage it
vim.lsp.config(name, {})
vim.lsp.enable(name)
elseif name == "vala_ls" then
vim.lsp.config(name, {})
vim.lsp.enable(name)