diff options
| -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 |
