From a92f976b8274755fa85ca58e2e76988ac506b0db Mon Sep 17 00:00:00 2001 From: Fredrik Averpil Date: Mon, 15 Jul 2024 13:19:05 +0200 Subject: [PATCH] chore: extend checkhealth with plugin checking (#136) --- lua/neotest-golang/health.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lua/neotest-golang/health.lua b/lua/neotest-golang/health.lua index ea06e9fb..d49aad72 100644 --- a/lua/neotest-golang/health.lua +++ b/lua/neotest-golang/health.lua @@ -12,6 +12,12 @@ local M = {} function M.check() M.go_binary_on_path() M.go_mod_found() + + M.is_plugin_available("neotest") + M.is_plugin_available("nvim-treesitter") + M.is_plugin_available("nio") + M.is_plugin_available("dap-go") + M.is_plugin_available("plenary") end function M.go_binary_on_path() @@ -39,4 +45,13 @@ function M.go_mod_found() end end +function M.is_plugin_available(plugin) + local is_plugin_available = pcall(require, plugin) + if is_plugin_available then + ok(plugin .. " is available") + else + warn(plugin .. " is not available") + end +end + return M