From c08b03076167837cff9eb66c19440d727e6dad31 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Sat, 15 Apr 2023 23:40:48 +0200 Subject: refactor: deprecate checkhealth functions The following functions are deprecated and will be removed in Nvim v0.11: - health#report_start() - health#report_info() - health#report_ok() - health#report_warn() - health#report_error() - vim.health.report_start() - vim.health.report_info() - vim.health.report_ok() - vim.health.report_warn() - vim.health.report_error() Users should instead use these: - vim.health.start() - vim.health.info() - vim.health.ok() - vim.health.warn() - vim.health.error() --- .../fixtures/lua/test_plug/autoload/health/test_plug.vim | 3 --- .../functional/fixtures/lua/test_plug/full_render/health.lua | 12 ++++++++++++ test/functional/fixtures/lua/test_plug/health/init.lua | 8 ++++---- test/functional/fixtures/lua/test_plug/submodule/health.lua | 8 ++++---- .../fixtures/lua/test_plug/submodule_failed/health.lua | 11 ----------- test/functional/fixtures/lua/test_plug/success1/health.lua | 10 ++++++++++ test/functional/fixtures/lua/test_plug/success2/health.lua | 8 ++++++++ 7 files changed, 38 insertions(+), 22 deletions(-) delete mode 100644 test/functional/fixtures/lua/test_plug/autoload/health/test_plug.vim create mode 100644 test/functional/fixtures/lua/test_plug/full_render/health.lua delete mode 100644 test/functional/fixtures/lua/test_plug/submodule_failed/health.lua create mode 100644 test/functional/fixtures/lua/test_plug/success1/health.lua create mode 100644 test/functional/fixtures/lua/test_plug/success2/health.lua (limited to 'test/functional/fixtures/lua/test_plug') diff --git a/test/functional/fixtures/lua/test_plug/autoload/health/test_plug.vim b/test/functional/fixtures/lua/test_plug/autoload/health/test_plug.vim deleted file mode 100644 index de05f56e9e..0000000000 --- a/test/functional/fixtures/lua/test_plug/autoload/health/test_plug.vim +++ /dev/null @@ -1,3 +0,0 @@ -function! health#success1#check() - call health#report_start("If you see this I'm broken") -endfunction diff --git a/test/functional/fixtures/lua/test_plug/full_render/health.lua b/test/functional/fixtures/lua/test_plug/full_render/health.lua new file mode 100644 index 0000000000..10833f6239 --- /dev/null +++ b/test/functional/fixtures/lua/test_plug/full_render/health.lua @@ -0,0 +1,12 @@ +local M = {} + +M.check = function() + vim.health.start('report 1') + vim.health.ok('life is fine') + vim.health.warn('no what installed', { 'pip what', 'make what' }) + vim.health.start('report 2') + vim.health.info('stuff is stable') + vim.health.error('why no hardcopy', { ':h :hardcopy', ':h :TOhtml' }) +end + +return M diff --git a/test/functional/fixtures/lua/test_plug/health/init.lua b/test/functional/fixtures/lua/test_plug/health/init.lua index 58162d4515..ef0c5ae3cd 100644 --- a/test/functional/fixtures/lua/test_plug/health/init.lua +++ b/test/functional/fixtures/lua/test_plug/health/init.lua @@ -1,10 +1,10 @@ local M = {} M.check = function() - vim.health.report_start("report 1") - vim.health.report_ok("everything is fine") - vim.health.report_start("report 2") - vim.health.report_ok("nothing to see here") + vim.health.start('report 1') + vim.health.ok('everything is fine') + vim.health.start('report 2') + vim.health.ok('nothing to see here') end return M diff --git a/test/functional/fixtures/lua/test_plug/submodule/health.lua b/test/functional/fixtures/lua/test_plug/submodule/health.lua index 58162d4515..ef0c5ae3cd 100644 --- a/test/functional/fixtures/lua/test_plug/submodule/health.lua +++ b/test/functional/fixtures/lua/test_plug/submodule/health.lua @@ -1,10 +1,10 @@ local M = {} M.check = function() - vim.health.report_start("report 1") - vim.health.report_ok("everything is fine") - vim.health.report_start("report 2") - vim.health.report_ok("nothing to see here") + vim.health.start('report 1') + vim.health.ok('everything is fine') + vim.health.start('report 2') + vim.health.ok('nothing to see here') end return M diff --git a/test/functional/fixtures/lua/test_plug/submodule_failed/health.lua b/test/functional/fixtures/lua/test_plug/submodule_failed/health.lua deleted file mode 100644 index ee5f4e404b..0000000000 --- a/test/functional/fixtures/lua/test_plug/submodule_failed/health.lua +++ /dev/null @@ -1,11 +0,0 @@ -local M = {} - -M.check = function() - vim.health.report_start("report 1") - vim.health.report_ok("everything is fine") - vim.health.report_warn("About to add a number to nil") - local a = nil + 2 - return a -end - -return M diff --git a/test/functional/fixtures/lua/test_plug/success1/health.lua b/test/functional/fixtures/lua/test_plug/success1/health.lua new file mode 100644 index 0000000000..ef0c5ae3cd --- /dev/null +++ b/test/functional/fixtures/lua/test_plug/success1/health.lua @@ -0,0 +1,10 @@ +local M = {} + +M.check = function() + vim.health.start('report 1') + vim.health.ok('everything is fine') + vim.health.start('report 2') + vim.health.ok('nothing to see here') +end + +return M diff --git a/test/functional/fixtures/lua/test_plug/success2/health.lua b/test/functional/fixtures/lua/test_plug/success2/health.lua new file mode 100644 index 0000000000..240a2d33de --- /dev/null +++ b/test/functional/fixtures/lua/test_plug/success2/health.lua @@ -0,0 +1,8 @@ +local M = {} + +M.check = function() + vim.health.start('another 1') + vim.health.ok('ok') +end + +return M -- cgit