From c82038aaa3e178d08863ea13cc200f22fc34b63c Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Thu, 13 Apr 2023 08:05:02 -0700 Subject: [PATCH] Properly handle exceptions when sourcing the test scripts --- autoload/lsp/lsp.vim | 6 ++---- test/runner.vim | 12 +++--------- 2 files changed, 5 insertions(+), 13 deletions(-) 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 -- 2.48.1