]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Option to ignore missing server
authorkohnish <kohnish@gmx.com>
Sat, 22 Jan 2022 17:08:51 +0000 (18:08 +0100)
committerkohnish <kohnish@gmx.com>
Mon, 24 Jan 2022 21:18:38 +0000 (22:18 +0100)
autoload/lsp.vim
autoload/lspoptions.vim
doc/lsp.txt

index 772da603016cf563bbfb570bd86996ecf3c4001e..82b2926d14e191bd4c25b75406c5cdbc42082470 100644 (file)
@@ -438,7 +438,9 @@ def lsp#addServer(serverList: list<dict<any>>)
     endif
 
     if !executable(server.path)
-      util.ErrMsg('Error: LSP server ' .. server.path .. ' is not found')
+      if !opt.lspOptions.ignoreMissingServer
+        util.ErrMsg('Error: LSP server ' .. server.path .. ' is not found')
+      endif
       return
     endif
     if server.args->type() != v:t_list
index bada2f840930d5dd046605f9f8b7409d215708e2..f779017440d507d1bedb499d87139dd6a7d39500 100644 (file)
@@ -29,6 +29,8 @@ export var lspOptions: dict<any> = {
   noDiagHoverOnLine: true,
   # Show a diagnostic message on a status line
   showDiagOnStatusLine: false,
+  # Don't print message when a configured language server is missing.
+  ignoreMissingServer: false
 }
 
 # set LSP options from user provided options
index 486c5e54dc8a597ab7f005afb6ae50bc66f4b60d..a16c0858bbf5ecbb475b8979e5586746be558612 100644 (file)
@@ -222,6 +222,8 @@ noDiagHoverOnLine   Suppress diagnostic hover from appearing when
                        By default this is set to true
 showDiagOnStatusLine   Show a diagnostic message on a status line.
                        By default this is set to false
+ignoreMissingServer    Do not print a missing language server executable.
+                       By default this is set to false
 
 For example, to disable the automatic placement of signs for the LSP
 diagnostic messages, you can add the following line to your .vimrc file: