suggest

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2018 License: MIT, MIT Imports: 14 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"`
}

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, error)

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