From 3d1f925f78c48fbe79e21a586347259b4057ac52 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 8 Jun 2025 17:36:09 +0200 Subject: [PATCH] nvim: Update mason-lspconfig for 2.0 --- nvim/.config/nvim/lua/core/languages.lua | 2 +- nvim/.config/nvim/lua/plugins/lsp.lua | 23 +++++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/nvim/.config/nvim/lua/core/languages.lua b/nvim/.config/nvim/lua/core/languages.lua index d604954..2bd28f3 100644 --- a/nvim/.config/nvim/lua/core/languages.lua +++ b/nvim/.config/nvim/lua/core/languages.lua @@ -71,7 +71,7 @@ local languages = { }, latex = { -- 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" }, }, lua = { diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua index 9f31a30..f2e7009 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -23,7 +23,21 @@ local lsp = { dependencies = { { "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" }, cmd = { "LspInstall", "LspUninstall" }, }, @@ -69,13 +83,6 @@ local lsp = { 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", { filetypes = { "markdown", "quarto" }, on_attach = function(client, _)