Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update healthcheck #438

Merged
merged 2 commits into from
Apr 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions lua/noice/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ local Config = require("noice.config")
local Lsp = require("noice.lsp")
local Treesitter = require("noice.text.treesitter")

local start = vim.health.start or vim.health.report_start
local ok = vim.health.ok or vim.health.report_ok
local warn = vim.health.warn or vim.health.report_warn
local error = vim.health.error or vim.health.report_error

local M = {}

M.checks = {}
Expand All @@ -13,19 +18,19 @@ M.log = {
---@class NoiceHealthLog
checkhealth = {
start = function(msg)
vim.health.report_start(msg or "noice.nvim")
start(msg or "noice.nvim")
end,
info = function(msg, ...)
vim.health.report_info(msg:format(...))
info(msg:format(...))
end,
ok = function(msg, ...)
vim.health.report_ok(msg:format(...))
ok(msg:format(...))
end,
warn = function(msg, ...)
vim.health.report_warn(msg:format(...))
warn(msg:format(...))
end,
error = function(msg, ...)
vim.health.report_error(msg:format(...))
error(msg:format(...))
end,
},
---@type NoiceHealthLog
Expand Down