[mirror] Make your go dev experience better github.com/olexsmir/gopher.nvim
neovim golang

chore: remove nvim-treesitter from dependencies (#107)

* refactor(health): remove treesitter from required plugins

* chore: remove nvim-treesitter from dependencies

* chore(health): update messages

authored by olexsmir.xyz and committed by GitHub ea28fc4e 847c79ab

Changed files
+3 -28
lua
gopher
+1 -4
README.md
··· 13 Requirements: 14 15 - **Neovim 0.10** or later 16 - - Treesitter `go` parser(`:TSInstall go`) 17 - [Go](https://github.com/golang/go) installed (tested on 1.23) 18 19 ```lua ··· 21 "olexsmir/gopher.nvim", 22 ft = "go", 23 -- branch = "develop" 24 - dependencies = { 25 - "nvim-treesitter/nvim-treesitter", 26 - }, 27 -- (optional) will update plugin's deps on every update 28 build = function() 29 vim.cmd.GoInstallDeps()
··· 13 Requirements: 14 15 - **Neovim 0.10** or later 16 + - Treesitter `go` parser(`:TSInstall go` if you use [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter)) 17 - [Go](https://github.com/golang/go) installed (tested on 1.23) 18 19 ```lua ··· 21 "olexsmir/gopher.nvim", 22 ft = "go", 23 -- branch = "develop" 24 -- (optional) will update plugin's deps on every update 25 build = function() 26 vim.cmd.GoInstallDeps()
+2 -21
lua/gopher/health.lua
··· 2 local cmd = require("gopher.config").commands 3 4 local deps = { 5 - plugin = { 6 - { lib = "nvim-treesitter", msg = "required for everything in gopher.nvim" }, 7 - }, 8 bin = { 9 { 10 bin = cmd.go, 11 - msg = "required for `:GoGet`, `:GoMod`, `:GoGenerate`, `:GoWork`, `:GoInstallDeps`", 12 optional = false, 13 }, 14 { bin = cmd.gomodifytags, msg = "required for `:GoTagAdd`, `:GoTagRm`", optional = true }, ··· 21 }, 22 }, 23 treesitter = { 24 - { parser = "go", msg = "required for `gopher.nvim`" }, 25 }, 26 } 27 28 - ---@param module string 29 - ---@return boolean 30 - local function is_lualib_found(module) 31 - local is_found, _ = pcall(require, module) 32 - return is_found 33 - end 34 - 35 ---@param bin string 36 ---@return boolean 37 local function is_binary_found(bin) ··· 46 end 47 48 function health.check() 49 - vim.health.start "required plugins" 50 - for _, plugin in ipairs(deps.plugin) do 51 - if is_lualib_found(plugin.lib) then 52 - vim.health.ok(plugin.lib .. " installed") 53 - else 54 - vim.health.error(plugin.lib .. " not found, " .. plugin.msg) 55 - end 56 - end 57 - 58 vim.health.start "required binaries" 59 vim.health.info "all those binaries can be installed by `:GoInstallDeps`" 60 for _, bin in ipairs(deps.bin) do
··· 2 local cmd = require("gopher.config").commands 3 4 local deps = { 5 bin = { 6 { 7 bin = cmd.go, 8 + msg = "required for `:GoGet`, `:GoMod`, `:GoGenerate`, `:GoWork`, `:GoInstallDeps`, `:GoInstallDepsSync`", 9 optional = false, 10 }, 11 { bin = cmd.gomodifytags, msg = "required for `:GoTagAdd`, `:GoTagRm`", optional = true }, ··· 18 }, 19 }, 20 treesitter = { 21 + { parser = "go", msg = "required for most of the parts of `gopher.nvim`" }, 22 }, 23 } 24 25 ---@param bin string 26 ---@return boolean 27 local function is_binary_found(bin) ··· 36 end 37 38 function health.check() 39 vim.health.start "required binaries" 40 vim.health.info "all those binaries can be installed by `:GoInstallDeps`" 41 for _, bin in ipairs(deps.bin) do
-3
pkg.json
··· 6 "repository": { 7 "type": "git", 8 "url": "https://github.com/olexsmir/gopher.nvim" 9 - }, 10 - "dependencies": { 11 - "https://github.com/nvim-treesitter/nvim-treesitter": "*" 12 } 13 }
··· 6 "repository": { 7 "type": "git", 8 "url": "https://github.com/olexsmir/gopher.nvim" 9 } 10 }