suggestion

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2020 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	gxui.DefaultAdapter
	// contains filtered or unexported fields
}

Adapter is an adapter that is based on gxui's FilteredListAdapter and CodeSuggestionAdapter. There are some differences mostly revolving around displaying the suggestions.

func (*Adapter) Len

func (a *Adapter) Len() int

func (*Adapter) Less

func (a *Adapter) Less(i, j int) bool

func (*Adapter) Pos

func (a *Adapter) Pos() int

func (*Adapter) Set

func (a *Adapter) Set(pos int, suggestions ...Suggestion)

func (*Adapter) Sort

func (a *Adapter) Sort(partial []rune) (longest int)

func (*Adapter) Swap

func (a *Adapter) Swap(i, j int)

type FileContainer

type FileContainer interface {
	Filepath() string
	Text() string
}

FileContainer is any type that contains information about a file.

type GoCodeProvider

type GoCodeProvider struct {
	// contains filtered or unexported fields
}

GoCodeProvider is a gocode-based implementation of gxui.CodeSyntaxProvider.

func NewGoCodeProvider

func NewGoCodeProvider(fileContainer FileContainer, environ []string) *GoCodeProvider

func (*GoCodeProvider) SuggestionsAt

func (p *GoCodeProvider) SuggestionsAt(runeIndex int) []Suggestion

type Suggestion

type Suggestion struct {
	Name      string
	Signature string
}

A suggestion is a simple implementation of gxui.CodeSuggestion.

func For

func For(environ []string, path, contents string, runeIndex int) ([]Suggestion, error)

func (Suggestion) String

func (s Suggestion) String() string

String handles displaying the suggestion.

TODO: Implement gxui.Viewer instead of gxui.Stringer, so that

we can syntax-highlight types in the completion list.

Jump to

Keyboard shortcuts

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