* refactor(ts_utils): i dont know why event it was here * fix: typos * fix(struct_tags)!: remove statement that i used for debug * refactor(ts_util): start from scratch * refactor(struct_tags): use new ts_util * fixup! refactor(struct_tags): use new ts_util * test(struct_tags): add support for multiple structs * fix(gotests): use new api * fix(impl): refactor some logic, use new api * docs(ts): add an explanation * refactor(_utils.ts): all public methods are just adapters * fix(comment): now it works * fixup! refactor(_utils.ts): all public methods are just adapters * fixup! fixup! refactor(_utils.ts): all public methods are just adapters * test(comment): e2e * tests(comment): fix * refactor(utils.ts): fix, docs * test(comment): fix tests again * fix(tests/comments): well, now i fell stupid * refactor(ts): add assert just to be sure that all elements are in the result * fix(ts): type annotations * fix(ts): pass bufnr to vim.treesitter.get_node * chore(ci): disable nightly * chore(ci): reorganize
70 lines
2 KiB
Lua
70 lines
2 KiB
Lua
--- *gopher.nvim*
|
|
---
|
|
--- ==============================================================================
|
|
---
|
|
--- gopher.nvim is a minimalistic plugin for Go development in Neovim written in Lua.
|
|
--- It's not an LSP tool, the main goal of this plugin is add go tooling support in Neovim.
|
|
|
|
--- Table of Contents
|
|
---@tag gopher.nvim-table-of-contents
|
|
---@toc
|
|
|
|
local log = require "gopher._utils.log"
|
|
local tags = require "gopher.struct_tags"
|
|
local tests = require "gopher.gotests"
|
|
local gocmd = require("gopher._utils.runner.gocmd").run
|
|
local gopher = {}
|
|
|
|
---@toc_entry Setup
|
|
---@tag gopher.nvim-setup
|
|
---@text Setup function. This method simply merges default config with opts table.
|
|
--- You can read more about configuration at |gopher.nvim-config|
|
|
--- Calling this function is optional, if you ok with default settings. Look |gopher.nvim.config-defaults|
|
|
---
|
|
---@usage `require("gopher").setup {}` (replace `{}` with your `config` table)
|
|
---@param user_config gopher.Config
|
|
gopher.setup = function(user_config)
|
|
log.debug "setting up config"
|
|
require("gopher.config").setup(user_config)
|
|
log.debug(vim.inspect(user_config))
|
|
end
|
|
|
|
---@toc_entry Install dependencies
|
|
---@tag gopher.nvim-install-deps
|
|
---@text Gopher.nvim implements most of its features using third-party tools.
|
|
--- To install these tools, you can run `:GoInstallDeps` command
|
|
--- or call `require("gopher").install_deps()` if you want to use lua api.
|
|
gopher.install_deps = require("gopher.installer").install_deps
|
|
|
|
gopher.impl = require("gopher.impl").impl
|
|
gopher.iferr = require("gopher.iferr").iferr
|
|
gopher.comment = require("gopher.comment").comment
|
|
|
|
gopher.tags = {
|
|
add = tags.add,
|
|
rm = tags.remove,
|
|
}
|
|
|
|
gopher.test = {
|
|
add = tests.func_test,
|
|
exported = tests.all_exported_tests,
|
|
all = tests.all_tests,
|
|
}
|
|
|
|
gopher.get = function(...)
|
|
gocmd("get", { ... })
|
|
end
|
|
|
|
gopher.mod = function(...)
|
|
gocmd("mod", { ... })
|
|
end
|
|
|
|
gopher.generate = function(...)
|
|
gocmd("generate", { ... })
|
|
end
|
|
|
|
gopher.work = function(...)
|
|
gocmd("work", { ... })
|
|
end
|
|
|
|
return gopher
|