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"`
}

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
}

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)