From 1b5851eb5602a443c831774940d802c8dd706c23 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Fri, 31 Jan 2025 17:37:25 +0000 Subject: [nvim][lsp] Adapt to lspconfig changes --- home/.config/nvim/lua/custom/plugins/lsp.lua | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'home') diff --git a/home/.config/nvim/lua/custom/plugins/lsp.lua b/home/.config/nvim/lua/custom/plugins/lsp.lua index b451be8..4447ff6 100644 --- a/home/.config/nvim/lua/custom/plugins/lsp.lua +++ b/home/.config/nvim/lua/custom/plugins/lsp.lua @@ -96,10 +96,19 @@ return { } for server, config in pairs(servers) do - local default_config = lspconfig[server].default_config or - lspconfig[server].document_config.default_config - local cmd = config.cmd or default_config.cmd - if vim.fn.executable(cmd[1]) == 1 then lspconfig[server].setup(config) end + local cmd = config.cmd + local config_def = lspconfig[server].config_def + if not cmd and config_def then + local default_config = config_def.default_config + if default_config then + cmd = default_config.cmd + end + end + if cmd then + if vim.fn.executable(cmd[1]) == 1 then + lspconfig[server].setup(config) + end + end end vim.api.nvim_create_autocmd("LspAttach", { -- cgit v1.2.3-70-g09d2