]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Properly handle exceptions when sourcing the test scripts
authorYegappan Lakshmanan <yegappan@yahoo.com>
Thu, 13 Apr 2023 15:05:02 +0000 (08:05 -0700)
committerYegappan Lakshmanan <yegappan@yahoo.com>
Thu, 13 Apr 2023 15:05:02 +0000 (08:05 -0700)
autoload/lsp/lsp.vim
test/runner.vim

index 8eb97a27625b7bd9a25728f614c1d6a74429c8bf..bb2232871d5940edbce0b975286d084d70623437 100644 (file)
@@ -539,10 +539,8 @@ export def AddServer(serverList: list<dict<any>>)
       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
index 845787a5ca09ff7d1f7ed78f0da2d03b0d2a243f..f706b275670b4778909f1b306d2549e5f2a74601 100644 (file)
@@ -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