nvim: Update mason-lspconfig for 2.0

This commit is contained in:
Marty Oehme 2025-06-08 17:36:09 +02:00
parent 63c6c81f6e
commit 3d1f925f78
Signed by: Marty
GPG key ID: 4E535BC19C61886E
2 changed files with 16 additions and 9 deletions

View file

@ -71,7 +71,7 @@ local languages = {
}, },
latex = { latex = {
-- TODO: May need to switch to ltex_plus at some point since ltex is unmaintained -- TODO: May need to switch to ltex_plus at some point since ltex is unmaintained
lsp = { ltex = { autostart = false }, texlab = {} }, lsp = { ltex = { disable = true }, texlab = {} },
ts = { "latex" }, ts = { "latex" },
}, },
lua = { lua = {

View file

@ -23,7 +23,21 @@ local lsp = {
dependencies = { dependencies = {
{ {
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
opts = { automatic_installation = true }, opts = function()
local to_install = {}
local not_enabled = {}
for k, v in pairs(get_all_servers()) do
table.insert(to_install, k)
if v["disable"] and v["disable"] == true then
table.insert(not_enabled, k)
end
end
local tbl = {
ensure_installed = to_install,
automatic_enable = { exclude = not_enabled },
}
return tbl
end,
dependencies = { "williamboman/mason.nvim" }, dependencies = { "williamboman/mason.nvim" },
cmd = { "LspInstall", "LspUninstall" }, cmd = { "LspInstall", "LspUninstall" },
}, },
@ -69,13 +83,6 @@ local lsp = {
end end
end end
for server_name, config in pairs(lspconfig_opts.servers) do
register(server_name, config)
if vim.fn.has("nvim-0.11") == 0 then
config.capabilities = require("blink.cmp").get_lsp_capabilities(config.capabilities)
end
end
register("marksman", { register("marksman", {
filetypes = { "markdown", "quarto" }, filetypes = { "markdown", "quarto" },
on_attach = function(client, _) on_attach = function(client, _)