Migrate for new vim.lsp.config API fron require("lspconfig")

This commit is contained in:
t0xa 2025-12-02 09:00:39 +03:00
parent b3032b57df
commit 7e149df236

View file

@ -1,4 +1,4 @@
local lspconfig = require("lspconfig")
-- Using vim.lsp.config() instead of require('lspconfig') (nvim-lspconfig >= 0.11)
local keymap = vim.keymap
@ -147,9 +147,12 @@ for name, config in pairs(servers) do
capabilities = capabilities,
}, config)
lspconfig[name].setup(config)
vim.lsp.config(name, config)
end
-- Enable the configured servers
vim.lsp.enable(vim.tbl_keys(servers))
-- Here it is used the LSP server attaches to file
vim.api.nvim_create_autocmd("LspAttach", {
-- Grouping together autocommands.