From: kohnish Date: Sat, 22 Jan 2022 17:08:51 +0000 (+0100) Subject: Option to ignore missing server X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=5310f5f9a3c47d6eca95f55f4c695a50c7681920;p=vim-lsp.git Option to ignore missing server --- diff --git a/autoload/lsp.vim b/autoload/lsp.vim index 772da60..82b2926 100644 --- a/autoload/lsp.vim +++ b/autoload/lsp.vim @@ -438,7 +438,9 @@ def lsp#addServer(serverList: list>) 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 diff --git a/autoload/lspoptions.vim b/autoload/lspoptions.vim index bada2f8..f779017 100644 --- a/autoload/lspoptions.vim +++ b/autoload/lspoptions.vim @@ -29,6 +29,8 @@ export var lspOptions: dict = { 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 diff --git a/doc/lsp.txt b/doc/lsp.txt index 486c5e5..a16c085 100644 --- a/doc/lsp.txt +++ b/doc/lsp.txt @@ -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: