diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua index 5077096..dab12f2 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -1,12 +1,15 @@ -local servers = {} -for _, lang in pairs(Languages) do - if not lang.lsp then - goto continue +local function get_all_servers() + local servers = {} + for _, lang in pairs(Languages) do + if not lang.lsp then + goto continue + end + for name, conf in pairs(lang.lsp) do + servers[name] = vim.tbl_deep_extend("force", servers[name] or {}, conf) + end + ::continue:: end - for name, conf in pairs(lang.lsp) do - servers[name] = vim.tbl_deep_extend("force", servers[name] or {}, conf) - end - ::continue:: + return servers end local lsp = { @@ -27,7 +30,7 @@ local lsp = { { "saghen/blink.cmp", optional = true }, }, event = { "BufReadPost", "BufNewFile", "BufWritePre" }, - opts = { servers = servers }, + opts = { servers = get_all_servers() }, config = function(_, lspconfig_opts) -- Display diagnostics as virtual text only if not in insert mode -- /r/neovim/comments/12inp4c/disable_diagnostics_virtual_text_when_in_insert/jqqifwk/