Documentation ¶
Index ¶
- Constants
- Variables
- func AppendSnippet(cx *CompletionCtx) []mg.Completion
- func BuildContext(mx *mg.Ctx) *build.Context
- func Dedent(s string) string
- func DedentCompletion(s string) string
- func DeferSnippet(cx *CompletionCtx) []mg.Completion
- func DocSnippet(cx *CompletionCtx) []mg.Completion
- func FuncSnippet(cx *CompletionCtx) []mg.Completion
- func GenDeclSnippet(cx *CompletionCtx) []mg.Completion
- func ImportPathSnippet(cx *CompletionCtx) []mg.Completion
- func InitFuncSnippet(cx *CompletionCtx) []mg.Completion
- func IsLetter(ch rune) bool
- func IsPkgDir(dir string) bool
- func MainFuncSnippet(cx *CompletionCtx) []mg.Completion
- func MapSnippet(cx *CompletionCtx) []mg.Completion
- func MethodSnippet(cx *CompletionCtx) []mg.Completion
- func NodeEnclosesPos(node ast.Node, pos token.Pos) bool
- func PackageNameSnippet(cx *CompletionCtx) []mg.Completion
- func PathList(p string) []string
- func TypeSnippet(cx *CompletionCtx) []mg.Completion
- type AsmFmt
- type CompletionCtx
- type CompletionScope
- type CursorCtx
- type CursorScope
- type DocNode
- type FmtFunc
- type GoCmd
- type GoGenerate
- type Gocode
- type GocodeCalltips
- type Guru
- type ImporterMode
- type Linter
- type MarGocodeCtl
- type ParsedFile
- type PosEnd
- type ReleaseVersion
- type SnippetFunc
- type SnippetFuncsList
- type SyntaxCheck
- type TestCmds
- type TypeCheck
Constants ¶
const ( AssignmentScope = cursor.AssignmentScope BlockScope = cursor.BlockScope CommentScope = cursor.CommentScope ConstScope = cursor.ConstScope DeferScope = cursor.DeferScope DocScope = cursor.DocScope ExprScope = cursor.ExprScope FileScope = cursor.FileScope FuncDeclScope = cursor.FuncDeclScope IdentScope = cursor.IdentScope ImportPathScope = cursor.ImportPathScope ImportScope = cursor.ImportScope PackageScope = cursor.PackageScope ReturnScope = cursor.ReturnScope SelectorScope = cursor.SelectorScope StringScope = cursor.StringScope TypeDeclScope = cursor.TypeDeclScope VarScope = cursor.VarScope )
const (
ParseFileMode = goutil.ParseFileMode
)
Variables ¶
var ( GoFmt mg.Reducer = mg.NewReducer(goFmt) GoImports mg.Reducer = mg.NewReducer(goImports) )
var ( NilPkgName = goutil.NilPkgName NilFset = goutil.NilFset NilPkgSrc = goutil.NilPkgSrc NilAstFile = goutil.NilAstFile NilTokenFile = goutil.NilTokenFile )
var ( VersionTag = goutil.VersionTag Version = goutil.Version )
var Reducers = []mg.Reducer{}
var (
Snippets = SnippetFuncs(append([]snippets.SnippetFunc{ImportPathSnippet}, snippets.DefaultSnippets...)...)
)
Functions ¶
func AppendSnippet ¶
func AppendSnippet(cx *CompletionCtx) []mg.Completion
AppendSnippet is an alias of snippets.AppendSnippet
func BuildContext ¶
BuildContext is an alias of goutil.BuildContext
func DedentCompletion ¶
DedentCompletion is an alias of goutil.DedentCompletion
func DeferSnippet ¶
func DeferSnippet(cx *CompletionCtx) []mg.Completion
DeferSnippet is an alias of snippets.DeferSnippet
func DocSnippet ¶
func DocSnippet(cx *CompletionCtx) []mg.Completion
DocSnippet is an alias of snippets.DocSnippet
func FuncSnippet ¶
func FuncSnippet(cx *CompletionCtx) []mg.Completion
FuncSnippet is an alias of snippets.FuncSnippet
func GenDeclSnippet ¶
func GenDeclSnippet(cx *CompletionCtx) []mg.Completion
GenDeclSnippet is an alias of snippets.GenDeclSnippet
func ImportPathSnippet ¶
func ImportPathSnippet(cx *CompletionCtx) []mg.Completion
func InitFuncSnippet ¶
func InitFuncSnippet(cx *CompletionCtx) []mg.Completion
InitFuncSnippet is an alias of snippets.InitFuncSnippet
func MainFuncSnippet ¶
func MainFuncSnippet(cx *CompletionCtx) []mg.Completion
MainFuncSnippet is an alias of snippets.MainFuncSnippet
func MapSnippet ¶
func MapSnippet(cx *CompletionCtx) []mg.Completion
MapSnippet is an alias of snippets.MapSnippet
func MethodSnippet ¶
func MethodSnippet(cx *CompletionCtx) []mg.Completion
MethodSnippet is an alias of snippets.MethodSnippet
func NodeEnclosesPos ¶
NodeEnclosesPos is an alias of goutil.NodeEnclosesPos
func PackageNameSnippet ¶
func PackageNameSnippet(cx *CompletionCtx) []mg.Completion
PackageNameSnippet is an alias of snippets.PackageNameSnippet
func TypeSnippet ¶
func TypeSnippet(cx *CompletionCtx) []mg.Completion
TypeSnippet is an alias of snippets.TypeSnippet
Types ¶
type AsmFmt ¶
type AsmFmt struct{ mg.ReducerType }
AsmFmt is a reducer that does code fmt'ing for `.s` files. It uses the package https://github.com/klauspost/asmfmt
type CompletionCtx ¶
type CompletionCtx = CursorCtx
func NewCompletionCtx ¶
func NewCompletionCtx(mx *mg.Ctx, src []byte, pos int) *CompletionCtx
NewCompletionCtx is an alias of cursor.NewCurCtx
type CompletionScope ¶
type CompletionScope = CursorScope
type CursorCtx ¶
func NewCursorCtx ¶
NewCursorCtx is an alias of cursor.NewCurCtx
func NewViewCursorCtx ¶
NewViewCursorCtx is an alias of cursor.NewViewCurCtx
type CursorScope ¶
type GoCmd ¶
type GoCmd struct { mg.ReducerType Humanize bool }
type GoGenerate ¶
type GoGenerate struct { mg.ReducerType // Args are extra arguments to pass to `go generate` Args []string }
GoGenerate adds a UserCmd that calls `go generate` in go packages and sub-dirs
type Gocode ¶
type Gocode struct { mg.ReducerType AllowExplicitCompletions bool AllowWordCompletions bool ShowFuncParams bool ShowFuncResultNames bool // Consider using MarGocodeCtl.Debug instead, it has more useful output Debug bool // This field is ignored, see MarGocodeCtl.ImporterMode Source bool // This field is ignored, see MarGocodeCtl.NoBuiltins ProposeBuiltins bool // This field is ignored, see MarGocodeCtl.ProposeTests ProposeTests bool // This field is ignored, see MarGocodeCtl.ImporterMode Autobuild bool // This field is ignored, See MarGocodeCtl.NoUnimportedPackages UnimportedPackages bool // contains filtered or unexported fields }
type GocodeCalltips ¶
type GocodeCalltips struct { mg.ReducerType // This field is ignored, see MarGocodeCtl.ImporterMode Source bool // Consider using MarGocodeCtl.Debug instead, it has more useful output Debug bool // contains filtered or unexported fields }
func (*GocodeCalltips) RMount ¶
func (gc *GocodeCalltips) RMount(mx *mg.Ctx)
func (*GocodeCalltips) RUnmount ¶
func (gc *GocodeCalltips) RUnmount(mx *mg.Ctx)
type Guru ¶
type Guru struct { mg.ReducerType // contains filtered or unexported fields }
type ImporterMode ¶
type ImporterMode int
ImporterMode specifies the mode in which the corresponding importer should operate
const ( // KimPorter tells the importer to use Kim-Porter to import packages KimPorter ImporterMode = iota // SrcImporterOnly tells the importer use source only, with no fall-back SrcImporterOnly // BinImporterOnly tells the importer use binary packages only, with no fall-back BinImporterOnly // SrcImporterWithFallback tells the importer use source code, then fall-back to a binary package SrcImporterWithFallback )
type Linter ¶
type Linter struct { mg.Linter Actions []mg.Action Name string Args []string Tag mg.IssueTag Label string TempDir []string }
Linter wraps mg.Linter to restrict its Langs to Go
all top-level fields are passed along to the underlying Linter
func GoInstallDiscardBinaries ¶
GoInstallDiscardBinaries returns a Linter that runs `go install args...` it's like GoInstall, but additionally sets GOBIN to a temp directory resulting in all binaries being discarded
type MarGocodeCtl ¶
type MarGocodeCtl struct { mg.ReducerType // Whether or not to print debugging info related to the gocode cache // used by the Gocode and GocodeCalltips reducers Debug bool // DebugPrune returns true if pkg should be removed from the cache DebugPrune func(pkg *types.Package) bool // The mode in which the types.Importer shouler operate // By default it is SrcImporterWithFallback ImporterMode ImporterMode // Don't try to automatically import packages when auto-compeltion fails // e.g. when `json.` is typed, if auto-complete fails // "encoding/json" is imported and auto-complete attempted on that package instead // See AddUnimportedPackages NoUnimportedPackages bool // If a package was imported internally for use in auto-completion, // insert it in the source code // See NoUnimportedPackages // e.g. after `json.` is typed, `import "encoding/json"` added to the code AddUnimportedPackages bool // Don't preload packages to speed up auto-completion, etc. NoPreloading bool // Don't propose builtin types and functions NoBuiltins bool // Whether or not to propose builtin types and functions ProposeTests bool }
func (*MarGocodeCtl) RInit ¶
func (mgc *MarGocodeCtl) RInit(mx *mg.Ctx)
type ParsedFile ¶
type ParsedFile = goutil.ParsedFile
func ParseFile ¶
func ParseFile(mx *mg.Ctx, fn string, src []byte) *ParsedFile
ParseFile is an alias of goutil.ParseFile
func ParseFileWithMode ¶
ParseFileWithMode is an alias of goutil.ParseFileWithMode
type ReleaseVersion ¶
type ReleaseVersion = goutil.ReleaseVersion
type SnippetFunc ¶
type SnippetFunc = snippets.SnippetFunc
SnippetFunc is an alias of snippets.SnippetFunc
type SnippetFuncsList ¶
type SnippetFuncsList struct { mg.ReducerType Funcs []SnippetFunc }
func SnippetFuncs ¶
func SnippetFuncs(l ...SnippetFunc) *SnippetFuncsList
type SyntaxCheck ¶
type SyntaxCheck struct { mg.ReducerType // contains filtered or unexported fields }
func (*SyntaxCheck) RMount ¶
func (sc *SyntaxCheck) RMount(mx *mg.Ctx)
func (*SyntaxCheck) RUnmount ¶
func (sc *SyntaxCheck) RUnmount(mx *mg.Ctx)
type TestCmds ¶
type TestCmds struct { mg.ReducerType // BenchArgs is a list of extra arguments to pass to `go test` for benchmarks // these are in addition to the usual `-test.run` and `-test.bench` args BenchArgs []string // TestArgs is a list of extra arguments to pass to `go test` for tests and examples // these are in addition to the usual `-test.run` arg TestArgs []string }