fix(health): remove deprecated API warnings (#28)

This commit is contained in:
J 2023-06-19 16:35:32 +02:00 committed by GitHub
parent f8947e998d
commit 9625a1710a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 5 deletions

View File

@ -1,22 +1,28 @@
local M = {} local M = {}
local health_start = vim.health.start or vim.health.report_start
local health_ok = vim.health.ok or vim.health.report_ok
local health_warn = vim.health.warn or vim.health.report_warn
local health_error = vim.health.error or vim.health.report_error
local health_info = vim.health.info or vim.health.report_info
function M.check() function M.check()
vim.health.report_start("neoconf.nvim") health_start("neoconf.nvim")
local function info(msg, ...) local function info(msg, ...)
vim.health.report_info(msg:format(...)) health_info(msg:format(...))
end end
local function ok(msg, ...) local function ok(msg, ...)
vim.health.report_ok(msg:format(...)) health_ok(msg:format(...))
end end
local function warn(msg, ...) local function warn(msg, ...)
vim.health.report_warn(msg:format(...)) health_warn(msg:format(...))
end end
local function error(msg, ...) local function error(msg, ...)
vim.health.report_error(msg:format(...)) health_warn(msg:format(...))
end end
local _, ts = pcall(require, "nvim-treesitter.parsers") local _, ts = pcall(require, "nvim-treesitter.parsers")