From: Yegappan Lakshmanan Date: Thu, 13 Apr 2023 15:05:02 +0000 (-0700) Subject: Properly handle exceptions when sourcing the test scripts X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=c82038aaa3e178d08863ea13cc200f22fc34b63c;p=vim-lsp.git Properly handle exceptions when sourcing the test scripts --- diff --git a/autoload/lsp/lsp.vim b/autoload/lsp/lsp.vim index 8eb97a27..bb22328 100644 --- a/autoload/lsp/lsp.vim +++ b/autoload/lsp/lsp.vim @@ -539,10 +539,8 @@ export def AddServer(serverList: list>) util.ErrMsg('Error: LSP server information is missing filetype or path') continue endif - if !server->has_key('omnicompl') - # Enable omni-completion by default - server['omnicompl'] = v:true - endif + # Enable omni-completion by default + server.omnicompl = get(server, 'omnicompl', v:true) if !server.path->executable() if !opt.lspOptions.ignoreMissingServer diff --git a/test/runner.vim b/test/runner.vim index 845787a..f706b27 100644 --- a/test/runner.vim +++ b/test/runner.vim @@ -5,8 +5,6 @@ vim9script source common.vim -g:LoadLspPlugin() - def LspRunTests() :set nomore :set debug=beep @@ -44,18 +42,14 @@ def LspRunTests() enddef try - + g:LoadLspPlugin() exe $'source {g:TestName}' g:StartLangServer() - + LspRunTests() catch - - call add(v:errors, $'Error: Failed to start language server for {g:TestName} with exception {v:exception} at {v:throwpoint}') - qall! - + writefile([$'FAIL: Tests in {g:TestName} failed with exception {v:exception} at {v:throwpoint} '], 'results.txt', 'a') endtry -LspRunTests() qall! # vim: shiftwidth=2 softtabstop=2 noexpandtab