Documentation
¶
Overview ¶
Package command provides the command of Go language development for Neovim.
Index ¶
- func Definition(q *guru.Query) (*serial.Definition, error)
- func RewriteFile(fset *token.FileSet, f *ast.File, info types.Info)
- type CmdBuildEval
- type CmdConfigEval
- type CmdVetEval
- type Command
- func (c *Command) Build(pctx context.Context, args []string, bang bool, eval *CmdBuildEval) interface{}
- func (c *Command) Config(ctx context.Context, args []string, eval *CmdConfigEval) interface{}
- func (c *Command) Fmt(pctx context.Context, dir string) interface{}
- func (c *Command) GenerateTest(ctx context.Context, args []string, ranges [2]int, bang bool, dir string) error
- func (c *Command) Guru(pctx context.Context, args []string, eval *funcGuruEval) interface{}
- func (c *Command) Iferr(ctx context.Context, file string) error
- func (c *Command) Lint(ctx context.Context, args []string, file string) interface{}
- func (c *Command) Metalinter(ctx context.Context, cwd string) error
- func (c *Command) Rename(pctx context.Context, args []string, bang bool, eval *cmdRenameEval) interface{}
- func (c *Command) Run(ctx context.Context, args []string, file string) error
- func (c *Command) SwitchTest(ctx context.Context, eval *cmdTestSwitchEval) error
- func (c *Command) Test(ctx context.Context, args []string, dir string) error
- func (c *Command) Vet(pctx context.Context, args []string, eval *CmdVetEval) interface{}
- type Config
- type ProjectConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Definition ¶
func Definition(q *guru.Query) (*serial.Definition, error)
Definition parse definition from the current cursor.
Types ¶
type CmdBuildEval ¶
CmdBuildEval struct type for Eval of GoBuild command.
type CmdConfigEval ¶
CmdConfigEval represents for the eval of GoConfig command.
type CmdVetEval ¶
CmdVetEval struct type for Eval of GoBuild command.
type Command ¶
Command represents a nvim-go plugins commands.
func NewCommand ¶
NewCommand return the new Command type with initialize some variables.
func Register ¶
Register register nvim-go command or function to Neovim over the msgpack-rpc plugin interface.
func (*Command) Build ¶
func (c *Command) Build(pctx context.Context, args []string, bang bool, eval *CmdBuildEval) interface{}
Build builds the current buffers package use compile tool that determined from the package directory structure.
func (*Command) Config ¶
func (c *Command) Config(ctx context.Context, args []string, eval *CmdConfigEval) interface{}
Config configs nvim-go plugin specific config. Such as enable appengine mode, set GOPATH for project or etc.
func (*Command) GenerateTest ¶
func (c *Command) GenerateTest(ctx context.Context, args []string, ranges [2]int, bang bool, dir string) error
GenerateTest generates the test files based by current buffer or args files functions.
func (*Command) Iferr ¶
Iferr automatically insert 'if err' Go idiom by parse the current buffer's Go abstract syntax tree(AST).
func (*Command) Lint ¶
Lint lints a go source file. The argument is a filename or directory path. TODO(zchee): Support go packages.
func (*Command) Metalinter ¶
Metalinter lint the Go sources from current buffer's package use gometalinter tool.
func (*Command) Rename ¶
func (c *Command) Rename(pctx context.Context, args []string, bang bool, eval *cmdRenameEval) interface{}
Rename rename the current cursor word use golang.org/x/tools/refactor/rename.
func (*Command) SwitchTest ¶
SwitchTest switch to the corresponds current cursor (Test)function.
type Config ¶
type Config struct {
Project map[string]ProjectConfig `yaml:"project"`
}