nvim: Extend lsp configuration with multiple declarations

So far if LSP declarations in 'core/languages.lua' were duplicated (e.g.
the 'astro' filetype and the 'vue' filetype both declare the
'typescript' lsp), one would simply overwrite the other. That is fine as
long as there is no custom setup, but if there is one of them is lost.

This commit changes it so that the different configurations extend each
other. The 'latter' one still overwrites the former but this is just
what must happen if there should be conflicting setups. 

May increase loading time slightly.
This commit is contained in:
Marty Oehme 2025-06-05 10:04:21 +02:00
parent 1d5fbef0fb
commit d2432e0039
Signed by: Marty
GPG key ID: 4E535BC19C61886E

View file

@ -4,7 +4,7 @@ for _, lang in pairs(Languages) do
goto continue goto continue
end end
for name, conf in pairs(lang.lsp) do for name, conf in pairs(lang.lsp) do
servers[name] = conf servers[name] = vim.tbl_deep_extend("force", servers[name] or {}, conf)
end end
::continue:: ::continue::
end end