Skip to content

Commit

Permalink
fix(health): fix deprecated health checks healthcheck (folke#438)
Browse files Browse the repository at this point in the history
* chore: update healthcheck

- *health#report_error* *vim.health.report_error()*	Use |vim.health.error()| instead.
- *health#report_info* *vim.health.report_info()*	Use |vim.health.info()| instead.
- *health#report_ok* *vim.health.report_ok()*		Use |vim.health.ok()| instead.
- *health#report_start* *vim.health.report_start()*	Use |vim.health.start()| instead.
- *health#report_warn* *vim.health.report_warn()*	Use |vim.health.warn()| instead.

* Allow for use of legacy health checks
  • Loading branch information
snelling-a authored Apr 22, 2023
1 parent 7bd435a commit 0f12ed3
Showing 1 changed file with 10 additions and 5 deletions.
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

0 comments on commit 0f12ed3

Please sign in to comment.