fix(health): check if bin is installed, and added message about treesitter parser
This commit is contained in:
parent
e0a3e70e48
commit
bbe89312c5
1 changed files with 9 additions and 7 deletions
|
|
@ -11,22 +11,24 @@ local deps = {
|
||||||
bin = {
|
bin = {
|
||||||
{
|
{
|
||||||
bin = cmd.go,
|
bin = cmd.go,
|
||||||
msg = "required for :GoGet, :GoMod, :GoGenerate, :GoWork, :GoInstallDeps",
|
msg = "required for `:GoGet`, `:GoMod`, `:GoGenerate`, `:GoWork`, `:GoInstallDeps`",
|
||||||
optional = false,
|
optional = false,
|
||||||
},
|
},
|
||||||
{ bin = cmd.gomodifytags, msg = "required for :GoTagAdd, :GoTagRm", optional = false },
|
{ bin = cmd.gomodifytags, msg = "required for `:GoTagAdd`, `:GoTagRm`", optional = false },
|
||||||
{ bin = cmd.impl, msg = "required for :GoImpl", optional = false },
|
{ bin = cmd.impl, msg = "required for `:GoImpl`", optional = false },
|
||||||
{ bin = cmd.iferr, msg = "required for :GoIfErr", optional = false },
|
{ bin = cmd.iferr, msg = "required for `:GoIfErr`", optional = false },
|
||||||
{
|
{
|
||||||
bin = cmd.gotests,
|
bin = cmd.gotests,
|
||||||
msg = "required for :GoTestAdd, :GoTestsAll, :GoTestsExp",
|
msg = "required for `:GoTestAdd`, `:GoTestsAll`, `:GoTestsExp`",
|
||||||
optional = false,
|
optional = false,
|
||||||
},
|
},
|
||||||
{ bin = cmd.dlv, msg = "required for debugging, (nvim-dap, `gopher.dap`)", optional = true },
|
{ bin = cmd.dlv, msg = "required for debugging, (`nvim-dap`, `gopher.dap`)", optional = true },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
function health.check()
|
function health.check()
|
||||||
|
u.info "install go treesitter parser by `:TSInstall go` if you don't have it already"
|
||||||
|
|
||||||
u.start "required plugins"
|
u.start "required plugins"
|
||||||
for _, plugin in ipairs(deps.plugin) do
|
for _, plugin in ipairs(deps.plugin) do
|
||||||
if u.is_lualib_found(plugin.lib) then
|
if u.is_lualib_found(plugin.lib) then
|
||||||
|
|
@ -43,7 +45,7 @@ function health.check()
|
||||||
u.start "required binaries"
|
u.start "required binaries"
|
||||||
u.info "all those binaries can be installed by `:GoInstallDeps`"
|
u.info "all those binaries can be installed by `:GoInstallDeps`"
|
||||||
for _, bin in ipairs(deps.bin) do
|
for _, bin in ipairs(deps.bin) do
|
||||||
if u.is_lualib_found(bin.bin) then
|
if u.is_binary_found(bin.bin) then
|
||||||
u.ok(bin.bin .. " installed")
|
u.ok(bin.bin .. " installed")
|
||||||
else
|
else
|
||||||
if bin.optional then
|
if bin.optional then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue