mirror of
https://github.com/neovim/neovim.git
synced 2026-07-31 12:49:11 +00:00
feat(health): improvements to :checkhealth #40935
Changes: - Removed the blank line before the first healthcheck header. - Fixed a bug where the entire "Terminal" section of `vim.health` would not appear if the `infocmp` executable was not found. - Fixed a typo in `vim.lsp` when displaying the LSP log level.
This commit is contained in:
@@ -459,7 +459,6 @@ function M._check(eap)
|
||||
for _, name in ipairs(names) do
|
||||
local value = healthchecks[name]
|
||||
progress_msg('running', check_idx, 'checking %s', name)
|
||||
check_idx = check_idx + 1
|
||||
local func = value[1]
|
||||
local type = value[2]
|
||||
s_output = {}
|
||||
@@ -508,7 +507,9 @@ function M._check(eap)
|
||||
end
|
||||
s_output[#s_output + 1] = ''
|
||||
s_output = vim.list_extend(header, s_output)
|
||||
vim.fn.append(vim.fn.line('$'), s_output)
|
||||
vim.api.nvim_buf_set_lines(0, check_idx == 1 and 0 or -1, -1, true, s_output)
|
||||
|
||||
check_idx = check_idx + 1
|
||||
end
|
||||
|
||||
progress_msg('success', nil, 'checks done')
|
||||
|
||||
@@ -486,15 +486,12 @@ local function check_graphics()
|
||||
end
|
||||
end
|
||||
|
||||
local function check_terminal()
|
||||
-- Note: this is part of check_terminal().
|
||||
local function check_infocmp()
|
||||
if vim.fn.executable('infocmp') == 0 then
|
||||
return
|
||||
end
|
||||
|
||||
health.start('Terminal')
|
||||
|
||||
check_graphics()
|
||||
|
||||
local cmd = { 'infocmp', '-L' }
|
||||
local ok, out = system(cmd)
|
||||
local kbs_entry = vim.fn.matchstr(out, 'key_backspace=[^,[:space:]]*')
|
||||
@@ -527,6 +524,14 @@ local function check_terminal()
|
||||
)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
local function check_terminal()
|
||||
health.start('Terminal')
|
||||
|
||||
check_graphics()
|
||||
|
||||
check_infocmp()
|
||||
|
||||
for _, env_var in ipairs({
|
||||
'XTERM_VERSION',
|
||||
|
||||
@@ -24,7 +24,7 @@ local function check_log()
|
||||
local log = vim.lsp.log
|
||||
local current_log_level = log.get_level()
|
||||
local log_level_string = log.levels[current_log_level] ---@type string
|
||||
report_info(string.format('LSP log level : %s', log_level_string))
|
||||
report_info(string.format('LSP log level: %s', log_level_string))
|
||||
|
||||
if current_log_level < log.levels.WARN then
|
||||
report_warn(
|
||||
|
||||
Reference in New Issue
Block a user