allow system bash-language-server
This commit is contained in:
1 parent
800d60a312
commit
67539072a5
3 files changed
+30
-4
No files matched your search
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user