From d2432e003912d371115ef32e567cab2f0f784291 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 5 Jun 2025 10:04:21 +0200 Subject: [PATCH] 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. --- nvim/.config/nvim/lua/plugins/lsp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua index 10d9e54..5077096 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -4,7 +4,7 @@ for _, lang in pairs(Languages) do goto continue end for name, conf in pairs(lang.lsp) do - servers[name] = conf + servers[name] = vim.tbl_deep_extend("force", servers[name] or {}, conf) end ::continue:: end