predict

package
v2.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2019 License: MIT Imports: 5 Imported by: 36 modules, 42 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package predict provides helper functions for completion predictors.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Something is used to indicate that does not completes somthing. Such that other prediction
	// wont be applied.
	Something = Set{""}

	// Nothing is used to indicate that does not completes anything.
	Nothing = Set{}
)

Functions

func Or

Or unions prediction functions, so that the result predication is the union of their predications.

Types

type FilesPredictor

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

func Dirs

func Dirs(pattern string) FilesPredictor

Dirs returns a predictor that predict directory paths. If a non-empty pattern is given, the predicted paths will match that pattern.

func Files

func Files(pattern string) FilesPredictor

Dirs returns a predictor that predict file or directory paths. If a non-empty pattern is given, the predicted paths will match that pattern.

func (FilesPredictor) Predict

func (f FilesPredictor) Predict(prefix string) (options []string)

Predict searches for files according to the given prefix. If the only predicted path is a single directory, the search will continue another recursive layer into that directory.

type FilesSet

type FilesSet []string

FilesSet predict according to file rules to a given fixed set of file names.

func (FilesSet) Predict

func (s FilesSet) Predict(prefix string) (prediction []string)

type Set

type Set []string

Set predicts a set of predefined values.

func (Set) Predict

func (p Set) Predict(_ string) (options []string)

Jump to

Keyboard shortcuts

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