From 9a4edafe09ccd0759675482bce720f2a0aec3386 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Magnus=20Gro=C3=9F?= Date: Wed, 31 May 2023 22:01:47 +0200 Subject: [PATCH] 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. --- autoload/lsp/lsp.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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') -- 2.48.1