mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
nvim/lsp: use newer lspconfig setup style
This commit is contained in:
parent
d86e3c989d
commit
366cb19a7c
2 changed files with 11 additions and 9 deletions
|
|
@ -91,12 +91,14 @@ vim.lsp.set_log_level("off")
|
|||
-- It is not recommended to break lspconfig into different settings
|
||||
-- related: https://github.com/neovim/nvim-lspconfig/issues/970#issuecomment-860080502
|
||||
for name, user_config in pairs(servers) do
|
||||
local default_config = {
|
||||
capabilities = mylsp.capabilities,
|
||||
settings = user_config,
|
||||
on_attach = function(client, bufno) mylsp.on_attach(client, bufno) end,
|
||||
}
|
||||
local merged_config = vim.tbl_deep_extend("force", default_config, user_config)
|
||||
|
||||
require("lspconfig")[name].setup(merged_config)
|
||||
if next(user_config) ~= nil then
|
||||
local default_config = {
|
||||
capabilities = mylsp.capabilities,
|
||||
settings = user_config,
|
||||
on_attach = function(client, bufno) mylsp.on_attach(client, bufno) end,
|
||||
}
|
||||
local merged_config = vim.tbl_deep_extend("force", default_config, user_config)
|
||||
vim.lsp.config(name, merged_config)
|
||||
end
|
||||
vim.lsp.enable(name)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue