completion

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Candidate

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

func ListDirAndFiles

func ListDirAndFiles(dir, prefix string) (res []Candidate, err error)

type CompletionItem

type CompletionItem struct {
	// Label holds the primary text user sees
	Label string

	// Detail a human-readable string with additional information
	// about this item, like type or symbol information.
	Detail string

	// InsertText holds the text to insert when user selects this completion.
	// It may be same with Label
	InsertText       string
	InsertTextFormat protocol.InsertTextFormat

	Kind       protocol.CompletionItemKind
	Deprecated bool

	Score int

	// Documentation holds document text for this completion
	Documentation string
}

func BuildCompletionItem

func BuildCompletionItem(candidate Candidate) *CompletionItem

type CompletionRequest

type CompletionRequest struct {
	TriggerKind int
	Pos         types.Position
	Fh          cache.FileHandle
}

type Interface

type Interface interface {
	Completion(ctx context.Context, ss *cache.Snapshot, cmp *CompletionRequest) ([]*CompletionItem, protocol.Range, error)
}
var DefaultTokenCompletion Interface = &TokenCompletion{}

type SemanticBasedCompletion

type SemanticBasedCompletion struct {
}

SemanticBasedCompletion generates completion list based on semantic. It is more precisely than token based completion TODO(jpf)

type TokenCompletion

type TokenCompletion struct {
}

TokenCompletion is token based completion. It generates completion list based on identifier in ast

func (*TokenCompletion) Completion

Jump to

Keyboard shortcuts

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