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

+2 -1
View File
@@ -29,6 +29,8 @@ NV_DARCULA_COLOR_SCHEME =
NV_DARCULA_TERMGUI_COLORS =
utils.parse_env("NV_DARCULA_TERMGUI_COLORS", utils.detect_termguicolors())
NV_DARCULA_ENABLE_COC = utils.parse_env("NV_DARCULA_ENABLE_COC", true)
NV_DARCULA_USE_SYSTEM_BASH_LS =
utils.parse_env("NV_DARCULA_USE_SYSTEM_BASH_LS", false)
NV_DARCULA_ENABLE_CODE_LENS =
utils.parse_env("NV_DARCULA_ENABLE_CODE_LENS", false)
NV_DARCULA_ENABLE_DAP = utils.parse_env("NV_DARCULA_ENABLE_DAP", true)
@@ -165,7 +167,6 @@ NV_DARCULA_MASON_INST_LIST =
utils.parse_env_list(
"NV_DARCULA_MASON_INST_LIST",
{
"bashls",
"clangd",
"cmake",
"cspell_ls",
+6
View File
@@ -35,6 +35,12 @@ require("mason").setup {
local ensure_installed = vim.deepcopy(NV_DARCULA_MASON_INST_LIST)
vim.list_extend(ensure_installed, NV_DARCULA_MASON_TOOL_LIST)
-- When not using the system-installed bash-language-server, let mason install
-- and manage bashls like any other server.
if not NV_DARCULA_USE_SYSTEM_BASH_LS then
table.insert(ensure_installed, "bashls")
end
local installer = require("mason-tool-installer")
installer.setup {
ensure_installed = ensure_installed,
+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)