From acd5e831b6294e54b12c09983bee3da89c0f183a Mon Sep 17 00:00:00 2001 From: Javier Lopez Date: Tue, 5 Oct 2021 17:37:39 -0500 Subject: fix(checkhealth): mitigate issues with duplicate healthchecks #15919 * fix(runtime/health): mitigate issues with duplicate healthchecks Previously if a healthcheck was found as Lua and Vim it was executed both times. This new implementations prefers Lua, therefore if two are found It only runs the Lua one, this way a plugin can mantain both implementations the Lua one with the method `check()` and the autoload function `#check()` (for none HEAD nvim versions). **Note: This will require plugins to use `check()` as the function name, since the autoload function that wraps the lua implementation won't be called** * docs(health): use spaces and don't overuse backtics followup to #15259 --- test/functional/plugin/health_spec.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/functional/plugin') diff --git a/test/functional/plugin/health_spec.lua b/test/functional/plugin/health_spec.lua index 2a86391e76..45fcf945f4 100644 --- a/test/functional/plugin/health_spec.lua +++ b/test/functional/plugin/health_spec.lua @@ -100,8 +100,10 @@ describe('health.vim', function() ]]) end) - it("lua plugins", function() + it("lua plugins, skips vimscript healthchecks with the same name", function() command("checkhealth test_plug") + -- Existing file in test/functional/fixtures/lua/test_plug/autoload/health/test_plug.vim + -- and the Lua healthcheck is used instead. helpers.expect([[ test_plug: require("test_plug.health").check() -- cgit