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 ¶
Types ¶
type Config ¶
type Config struct { complete.Predictor // contains filtered or unexported fields }
Config stores prediction options.
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.
Click to show internal directories.
Click to hide internal directories.