Skip to content

Commit

Permalink
chore: extend checkhealth with plugin checking
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikaverpil committed Jul 15, 2024
1 parent b1bda05 commit 0ee7b5e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lua/neotest-golang/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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

0 comments on commit 0ee7b5e

Please sign in to comment.