diff options
| author | Hirokazu Hata <h.hata.ai.t@gmail.com> | 2020-05-24 10:27:34 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-24 10:27:34 +0900 |
| commit | 54f4f823a27ffa8f9e6c308d550888f3ae21373e (patch) | |
| tree | f6b310220e1e6368529643cd0e0756a5730fde55 /lua | |
| parent | Merge pull request #244 from h-michael/test (diff) | |
| parent | healthcheck: skip healthcheck if make_config function is nil (diff) | |
| download | nvim-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.lua | 28 |
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 |
