suggest

package
v0.0.0-...-9a46783 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2019 License: Apache-2.0, MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Formatters = map[string]Formatter{
	"csv":              csvFormat,
	"csv-with-package": csvFormat,
	"emacs":            emacsFormat,
	"godit":            goditFormat,
	"json":             jsonFormat,
	"nice":             NiceFormat,
	"vim":              vimFormat,
}

Functions

func NiceFormat

func NiceFormat(w io.Writer, candidates []Candidate, num int)

Types

type Candidate

type Candidate struct {
	Class    string `json:"class"`
	PkgPath  string `json:"package"`
	Name     string `json:"name"`
	Type     string `json:"type"`
	Receiver string `json:"receiver,omitempty"`
}

func (Candidate) String

func (c Candidate) String() string

func (Candidate) Suggestion

func (c Candidate) Suggestion() string

type Config

type Config struct {
	Importer           types.Importer
	Logf               func(fmt string, args ...interface{})
	Builtin            bool
	IgnoreCase         bool
	UnimportedPackages bool
}

func (*Config) Suggest

func (c *Config) Suggest(filename string, data []byte, cursor int) ([]Candidate, int)

Suggest returns a list of suggestion candidates and the length of the text that should be replaced, if any.

type Formatter

type Formatter func(w io.Writer, candidates []Candidate, num int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL