completer

package
v0.0.0-...-ea2a2fb Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filterer

type Filterer[T any] interface {
	Filter(
		search string,
		suggestions []suggestion.Suggestion[T],
	) []suggestion.Suggestion[T]
}

type FuzzyFilter

type FuzzyFilter[T any] struct{}

func NewFuzzyFilter

func NewFuzzyFilter[T any]() FuzzyFilter[T]

func (FuzzyFilter[T]) Filter

func (f FuzzyFilter[T]) Filter(
	search string,
	suggestions []suggestion.Suggestion[T],
) []suggestion.Suggestion[T]

type Metadata

type Metadata[T any] interface {
	GetChildren() []suggestion.Suggestion[T]
}

type PathCompleter

type PathCompleter[T any] struct {
	DirFilter  func(de fs.DirEntry) bool
	IgnoreCase bool
	Filterer   Filterer[T]
	// contains filtered or unexported fields
}

func (*PathCompleter[T]) Complete

func (c *PathCompleter[T]) Complete(path string) []suggestion.Suggestion[T]

type PrefixFilter

type PrefixFilter[T any] struct{}

func NewPrefixFilter

func NewPrefixFilter[T any]() PrefixFilter[T]

func (PrefixFilter[T]) Filter

func (f PrefixFilter[T]) Filter(
	search string,
	suggestions []suggestion.Suggestion[T],
) []suggestion.Suggestion[T]

type RecursiveFilterer

type RecursiveFilterer[T Metadata[T]] struct {
	Filterer Filterer[T]
}

func NewRecursiveFilterer

func NewRecursiveFilterer[T Metadata[T]]() RecursiveFilterer[T]

func (RecursiveFilterer[T]) GetRecursiveSuggestions

func (f RecursiveFilterer[T]) GetRecursiveSuggestions(
	tokens []input.Token,
	cursor int,
	suggestions []suggestion.Suggestion[T],
) []suggestion.Suggestion[T]

Jump to

Keyboard shortcuts

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