mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49: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
|
|
@ -22,7 +22,7 @@
|
||||||
"nvim-colorizer.lua": { "branch": "master", "commit": "517df88cf2afb36652830df2c655df2da416a0ae" },
|
"nvim-colorizer.lua": { "branch": "master", "commit": "517df88cf2afb36652830df2c655df2da416a0ae" },
|
||||||
"nvim-dap": { "branch": "master", "commit": "40a8189b8a57664a1850b0823fdcb3ac95b9f635" },
|
"nvim-dap": { "branch": "master", "commit": "40a8189b8a57664a1850b0823fdcb3ac95b9f635" },
|
||||||
"nvim-jdtls": { "branch": "master", "commit": "4d77ff02063cf88963d5cf10683ab1fd15d072de" },
|
"nvim-jdtls": { "branch": "master", "commit": "4d77ff02063cf88963d5cf10683ab1fd15d072de" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "463b16bd6a347a129367a7fd00ebcdd9442d9a96" },
|
"nvim-lspconfig": { "branch": "master", "commit": "b8c3630ce37dfbe51910b68785a71620b072c41a" },
|
||||||
"nvim-metals": { "branch": "main", "commit": "852b8aa60d8ca30e14ef9253ced91656e845cfb7" },
|
"nvim-metals": { "branch": "main", "commit": "852b8aa60d8ca30e14ef9253ced91656e845cfb7" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "89ebe73cd2836db80a22d9748999ace0241917a5" },
|
"nvim-treesitter-textobjects": { "branch": "master", "commit": "89ebe73cd2836db80a22d9748999ace0241917a5" },
|
||||||
|
|
|
||||||
|
|
@ -91,12 +91,14 @@ vim.lsp.set_log_level("off")
|
||||||
-- It is not recommended to break lspconfig into different settings
|
-- It is not recommended to break lspconfig into different settings
|
||||||
-- related: https://github.com/neovim/nvim-lspconfig/issues/970#issuecomment-860080502
|
-- related: https://github.com/neovim/nvim-lspconfig/issues/970#issuecomment-860080502
|
||||||
for name, user_config in pairs(servers) do
|
for name, user_config in pairs(servers) do
|
||||||
local default_config = {
|
if next(user_config) ~= nil then
|
||||||
capabilities = mylsp.capabilities,
|
local default_config = {
|
||||||
settings = user_config,
|
capabilities = mylsp.capabilities,
|
||||||
on_attach = function(client, bufno) mylsp.on_attach(client, bufno) end,
|
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)
|
}
|
||||||
|
local merged_config = vim.tbl_deep_extend("force", default_config, user_config)
|
||||||
require("lspconfig")[name].setup(merged_config)
|
vim.lsp.config(name, merged_config)
|
||||||
|
end
|
||||||
|
vim.lsp.enable(name)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue