From: Magnus Groß Date: Wed, 31 May 2023 20:01:47 +0000 (+0200) Subject: Skip invalid servers instead of aborting in LspAddServer() X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=9a4edafe09ccd0759675482bce720f2a0aec3386;p=vim-lsp.git Skip invalid servers instead of aborting in LspAddServer() If the user calls LspAddServer() with a list of servers, where the very first entry does not exist, but all the remaining ones do, then no servers are added at all. This doesn't make much sense, as the other entries might be valid entries. Fix this by simply continuing with the next entry instead of returning when encountering an error. --- diff --git a/autoload/lsp/lsp.vim b/autoload/lsp/lsp.vim index d3f5e33..00aadac 100644 --- a/autoload/lsp/lsp.vim +++ b/autoload/lsp/lsp.vim @@ -598,13 +598,13 @@ export def AddServer(serverList: list>) if !opt.lspOptions.ignoreMissingServer util.ErrMsg($'LSP server {server.path} is not found') endif - return + continue endif var args: list = [] if server->has_key('args') if server.args->type() != v:t_list util.ErrMsg($'Arguments for LSP server {server.args} is not a List') - return + continue endif args = server.args endif @@ -623,7 +623,7 @@ export def AddServer(serverList: list>) if server->has_key('processDiagHandler') if server.processDiagHandler->type() != v:t_func util.ErrMsg($'Setting of processDiagHandler {server.processDiagHandler} is not a Funcref nor lambda') - return + continue endif ProcessDiagHandler = server.processDiagHandler endif @@ -640,7 +640,7 @@ export def AddServer(serverList: list>) if server.omnicompl->type() != v:t_bool util.ErrMsg($'Setting of omnicompl {server.omnicompl} is not a Boolean') - return + continue endif if !server->has_key('syncInit')