diff options
author | 2025-01-31 17:37:25 +0000 | |
---|---|---|
committer | 2025-01-31 17:56:08 +0000 | |
commit | 1b5851eb5602a443c831774940d802c8dd706c23 (patch) | |
tree | 63da27661291c931459fc5f260bb1ef7a1870cf2 /home | |
parent | 513c83a07471e45bfc3ba5f4d225b521a56f5af5 (diff) | |
download | dotfiles-1b5851eb5602a443c831774940d802c8dd706c23.tar.gz dotfiles-1b5851eb5602a443c831774940d802c8dd706c23.tar.bz2 dotfiles-1b5851eb5602a443c831774940d802c8dd706c23.zip |
[nvim][lsp] Adapt to lspconfig changes
Diffstat (limited to 'home')
-rw-r--r-- | home/.config/nvim/lua/custom/plugins/lsp.lua | 17 |
1 files changed, 13 insertions, 4 deletions
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", { |