mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
nvim/lsp: allow setting all lsp config field in user config
This commit is contained in:
parent
c8fd1b4163
commit
ead40c844d
1 changed files with 9 additions and 4 deletions
|
|
@ -20,7 +20,9 @@ local servers = {
|
|||
-- golangci_lint_ls = {},
|
||||
tinymist = {},
|
||||
nil_ls = {
|
||||
["nil"] = { formatting = { command = { "alejandra" } } },
|
||||
settings = {
|
||||
["nil"] = { formatting = { command = { "alejandra" } } },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -55,10 +57,13 @@ 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, config in pairs(servers) do
|
||||
require("lspconfig")[name].setup {
|
||||
for name, user_config in pairs(servers) do
|
||||
local default_config = {
|
||||
capabilities = mylsp.capabilities,
|
||||
settings = config,
|
||||
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)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue