aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorHirokazu Hata <h.hata.ai.t@gmail.com>2020-05-24 10:27:34 +0900
committerGitHub <noreply@github.com>2020-05-24 10:27:34 +0900
commit54f4f823a27ffa8f9e6c308d550888f3ae21373e (patch)
treef6b310220e1e6368529643cd0e0756a5730fde55 /lua
parentMerge pull request #244 from h-michael/test (diff)
parenthealthcheck: skip healthcheck if make_config function is nil (diff)
downloadnvim-lspconfig-54f4f823a27ffa8f9e6c308d550888f3ae21373e.tar
nvim-lspconfig-54f4f823a27ffa8f9e6c308d550888f3ae21373e.tar.gz
nvim-lspconfig-54f4f823a27ffa8f9e6c308d550888f3ae21373e.tar.bz2
nvim-lspconfig-54f4f823a27ffa8f9e6c308d550888f3ae21373e.tar.lz
nvim-lspconfig-54f4f823a27ffa8f9e6c308d550888f3ae21373e.tar.xz
nvim-lspconfig-54f4f823a27ffa8f9e6c308d550888f3ae21373e.tar.zst
nvim-lspconfig-54f4f823a27ffa8f9e6c308d550888f3ae21373e.zip
Merge pull request #249 from neovim/healthcheck
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim_lsp/health.lua28
1 files changed, 13 insertions, 15 deletions
diff --git a/lua/nvim_lsp/health.lua b/lua/nvim_lsp/health.lua
index f319a265..d0e5820e 100644
--- a/lua/nvim_lsp/health.lua
+++ b/lua/nvim_lsp/health.lua
@@ -3,23 +3,21 @@ function M.check_health()
local configs = require 'nvim_lsp/configs'
for _, top_level_config in pairs(configs) do
- -- the folder needs to exist
- local config = top_level_config.make_config(".")
+ -- If users execute `:LspInstall` or `:LspInstallInfo`,
+ -- a config is required but is not added make_config function.
+ if not (top_level_config.make_config == nil) then
+ -- the folder needs to exist
+ local config = top_level_config.make_config(".")
- local status, cmd = pcall(vim.lsp._cmd_parts, config.cmd)
- if not status then
- vim.fn['health#report_error'](
- string.format("%s: config.cmd error, %s", config.name, cmd)
- )
- else
- if not (vim.fn.executable(cmd) == 1) then
- vim.fn['health#report_error'](
- string.format("%s: The given command %q is not executable.", config.name, cmd)
- )
+ local status, cmd = pcall(vim.lsp._cmd_parts, config.cmd)
+ if not status then
+ vim.fn['health#report_error'](string.format("%s: config.cmd error, %s", config.name, cmd))
else
- vim.fn['health#report_info'](
- string.format("%s: configuration checked.", config.name)
- )
+ if not (vim.fn.executable(cmd) == 1) then
+ vim.fn['health#report_error'](string.format("%s: The given command %q is not executable.", config.name, cmd))
+ else
+ vim.fn['health#report_info'](string.format("%s: configuration checked.", config.name))
+ end
end
end
end