chore: remove nvim-treesitter from dependencies (#107)
* refactor(health): remove treesitter from required plugins * chore: remove nvim-treesitter from dependencies * chore(health): update messages
This commit is contained in:
parent
847c79ab76
commit
ea28fc4e6f
3 changed files with 3 additions and 28 deletions
|
|
@ -13,7 +13,7 @@ It's **NOT** an LSP tool, the main goal of this plugin is to add go tooling supp
|
||||||
Requirements:
|
Requirements:
|
||||||
|
|
||||||
- **Neovim 0.10** or later
|
- **Neovim 0.10** or later
|
||||||
- Treesitter `go` parser(`:TSInstall go`)
|
- Treesitter `go` parser(`:TSInstall go` if you use [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter))
|
||||||
- [Go](https://github.com/golang/go) installed (tested on 1.23)
|
- [Go](https://github.com/golang/go) installed (tested on 1.23)
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
|
|
@ -21,9 +21,6 @@ Requirements:
|
||||||
"olexsmir/gopher.nvim",
|
"olexsmir/gopher.nvim",
|
||||||
ft = "go",
|
ft = "go",
|
||||||
-- branch = "develop"
|
-- branch = "develop"
|
||||||
dependencies = {
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
},
|
|
||||||
-- (optional) will update plugin's deps on every update
|
-- (optional) will update plugin's deps on every update
|
||||||
build = function()
|
build = function()
|
||||||
vim.cmd.GoInstallDeps()
|
vim.cmd.GoInstallDeps()
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,10 @@ local health = {}
|
||||||
local cmd = require("gopher.config").commands
|
local cmd = require("gopher.config").commands
|
||||||
|
|
||||||
local deps = {
|
local deps = {
|
||||||
plugin = {
|
|
||||||
{ lib = "nvim-treesitter", msg = "required for everything in gopher.nvim" },
|
|
||||||
},
|
|
||||||
bin = {
|
bin = {
|
||||||
{
|
{
|
||||||
bin = cmd.go,
|
bin = cmd.go,
|
||||||
msg = "required for `:GoGet`, `:GoMod`, `:GoGenerate`, `:GoWork`, `:GoInstallDeps`",
|
msg = "required for `:GoGet`, `:GoMod`, `:GoGenerate`, `:GoWork`, `:GoInstallDeps`, `:GoInstallDepsSync`",
|
||||||
optional = false,
|
optional = false,
|
||||||
},
|
},
|
||||||
{ bin = cmd.gomodifytags, msg = "required for `:GoTagAdd`, `:GoTagRm`", optional = true },
|
{ bin = cmd.gomodifytags, msg = "required for `:GoTagAdd`, `:GoTagRm`", optional = true },
|
||||||
|
|
@ -21,17 +18,10 @@ local deps = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
treesitter = {
|
treesitter = {
|
||||||
{ parser = "go", msg = "required for `gopher.nvim`" },
|
{ parser = "go", msg = "required for most of the parts of `gopher.nvim`" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
---@param module string
|
|
||||||
---@return boolean
|
|
||||||
local function is_lualib_found(module)
|
|
||||||
local is_found, _ = pcall(require, module)
|
|
||||||
return is_found
|
|
||||||
end
|
|
||||||
|
|
||||||
---@param bin string
|
---@param bin string
|
||||||
---@return boolean
|
---@return boolean
|
||||||
local function is_binary_found(bin)
|
local function is_binary_found(bin)
|
||||||
|
|
@ -46,15 +36,6 @@ local function is_treesitter_parser_available(ft)
|
||||||
end
|
end
|
||||||
|
|
||||||
function health.check()
|
function health.check()
|
||||||
vim.health.start "required plugins"
|
|
||||||
for _, plugin in ipairs(deps.plugin) do
|
|
||||||
if is_lualib_found(plugin.lib) then
|
|
||||||
vim.health.ok(plugin.lib .. " installed")
|
|
||||||
else
|
|
||||||
vim.health.error(plugin.lib .. " not found, " .. plugin.msg)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.health.start "required binaries"
|
vim.health.start "required binaries"
|
||||||
vim.health.info "all those binaries can be installed by `:GoInstallDeps`"
|
vim.health.info "all those binaries can be installed by `:GoInstallDeps`"
|
||||||
for _, bin in ipairs(deps.bin) do
|
for _, bin in ipairs(deps.bin) do
|
||||||
|
|
|
||||||
3
pkg.json
3
pkg.json
|
|
@ -6,8 +6,5 @@
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/olexsmir/gopher.nvim"
|
"url": "https://github.com/olexsmir/gopher.nvim"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"https://github.com/nvim-treesitter/nvim-treesitter": "*"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue