+7
lua/gopher/_utils/health.lua
lua/gopher/_utils/health_util.lua
+7
lua/gopher/_utils/health.lua
lua/gopher/_utils/health_util.lua
+13
-3
lua/gopher/health.lua
+13
-3
lua/gopher/health.lua
···
1
1
local health = {}
2
2
local cmd = require("gopher.config").commands
3
-
local u = require "gopher._utils.health"
3
+
local u = require "gopher._utils.health_util"
4
4
5
5
local deps = {
6
6
plugin = {
···
24
24
},
25
25
{ bin = cmd.dlv, msg = "required for debugging, (`nvim-dap`, `gopher.dap`)", optional = true },
26
26
},
27
+
treesitter = {
28
+
{ parser = "go", msg = "required for `gopher.nvim`", optional = false },
29
+
},
27
30
}
28
31
29
32
function health.check()
30
-
u.info "install go treesitter parser by `:TSInstall go` if you don't have it already"
31
-
32
33
u.start "required plugins"
33
34
for _, plugin in ipairs(deps.plugin) do
34
35
if u.is_lualib_found(plugin.lib) then
···
53
54
else
54
55
u.error(bin.bin .. " not found, " .. bin.msg)
55
56
end
57
+
end
58
+
end
59
+
60
+
u.start "required treesitter parsers"
61
+
for _, parser in ipairs(deps.treesitter) do
62
+
if u.is_treesitter_parser_available(parser.parser) then
63
+
u.ok(parser.parser .. " parser installed")
64
+
else
65
+
u.error(parser.parser .. " parser not found, " .. parser.msg)
56
66
end
57
67
end
58
68
end