From: Samir Benmendil Date: Mon, 27 Oct 2025 22:19:24 +0000 (+0000) Subject: nvim: replace require('lspconfig') with vim.lsp.config X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/b232dd23c7bb961528e8656742e9b27fb1825153?ds=sidebyside nvim: replace require('lspconfig') with vim.lsp.config The former has been deprecated. --- diff --git a/nvim/lua/plugins/lsp/init.lua b/nvim/lua/plugins/lsp/init.lua index 132c412..09adfdd 100644 --- a/nvim/lua/plugins/lsp/init.lua +++ b/nvim/lua/plugins/lsp/init.lua @@ -83,7 +83,6 @@ return { }, ---@param opts PluginLspOpts config = function(_, opts) - local lspconfig = require('lspconfig') for server, config in pairs(opts.servers) do local capabilities = vim.tbl_deep_extend("force", vim.lsp.protocol.make_client_capabilities() or {}, @@ -91,7 +90,7 @@ return { config.capabilities or {} ) config.capabilities = capabilities - lspconfig[server].setup(config) + vim.lsp.config(server, config) end -- setup keymaps @@ -116,7 +115,7 @@ return { if server_opts.enabled ~= false then -- run manual setup if mason=false or if this is a server that cannot be installed with mason-lspconfig if server_opts.mason == false or not vim.tbl_contains(all_mslp_servers, server) then - require("lspconfig")[server].setup(server_opts) + vim.lsp.config(server, server_opts) else ensure_installed[#ensure_installed + 1] = server end