aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/home/.config/nvim/lua/custom/plugins/lsp.lua
diff options
context:
space:
mode:
Diffstat (limited to 'home/.config/nvim/lua/custom/plugins/lsp.lua')
-rw-r--r--home/.config/nvim/lua/custom/plugins/lsp.lua17
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", {