fix: migrate to native vim.lsp.config for nvim 0.11+ (#1776)

Replaces the deprecated `require('lspconfig')[name].setup()` pattern
with Neovim's native `vim.lsp.config` and `vim.lsp.enable` APIs within
the Mason handler.

`nvim-lspconfig` is deprecating its internal framework logic in favor of
Neovim's core LSP management. This change resolves the deprecation
warning and ensures compatibility with nvim-lspconfig v3.0.0.
This commit is contained in:
Ziqi Wang 2025-12-15 10:59:27 +02:00
parent 3338d39206
commit 72b5065a66
1 changed files with 2 additions and 1 deletions

View File

@ -729,7 +729,8 @@ require('lazy').setup({
-- by the server configuration above. Useful when disabling -- by the server configuration above. Useful when disabling
-- certain features of an LSP (for example, turning off formatting for ts_ls) -- certain features of an LSP (for example, turning off formatting for ts_ls)
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
require('lspconfig')[server_name].setup(server) vim.lsp.config(server_name, server)
vim.lsp.enable(server_name)
end, end,
}, },
} }