]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Add error checking for the config "processDiagHandler"
authorAndreas Louv <andreas@louv.dk>
Sat, 20 May 2023 19:38:47 +0000 (21:38 +0200)
committerAndreas Louv <andreas@louv.dk>
Sat, 20 May 2023 19:38:47 +0000 (21:38 +0200)
autoload/lsp/lsp.vim

index edecb3ffba1ef3634aef4983e7951db4e3aa34e6..4b13403f758e6ea6196b669a9cadb67b2706a6c6 100644 (file)
@@ -614,6 +614,11 @@ export def AddServer(serverList: list<dict<any>>)
 
     var ProcessDiagHandler: func = null_function
     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
+      endif
+
       ProcessDiagHandler = server.processDiagHandler
     endif