From 9aa3de5561ca8dc87b841c0618ae98608fb81b82 Mon Sep 17 00:00:00 2001 From: Andy Zhang Date: Sat, 10 Sep 2022 19:46:10 +0800 Subject: [PATCH] fix(lsp): type error when loading lsp config (#4701) --- autoload/SpaceVim/layers/lsp.vim | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/autoload/SpaceVim/layers/lsp.vim b/autoload/SpaceVim/layers/lsp.vim index 67a181117..d6a9dc816 100644 --- a/autoload/SpaceVim/layers/lsp.vim +++ b/autoload/SpaceVim/layers/lsp.vim @@ -102,13 +102,15 @@ for _, lsp in ipairs(servers) do end local override_client_cmds = require('spacevim').eval('s:override_client_cmds') for client, override_cmd in pairs(override_client_cmds) do - nvim_lsp[client].setup { - cmd = override_cmd, - on_attach = on_attach, - flags = { - debounce_text_changes = 150, + if type(client) == "string" then + nvim_lsp[client].setup { + cmd = override_cmd, + on_attach = on_attach, + flags = { + debounce_text_changes = 150, + } } - } + end end EOF endfunction