class
Opal::Input::Autocomplete
- Opal::Input::Autocomplete
- Reference
- Object
Overview
Autocompletion engine supporting static dictionaries, dynamic providers, and ghost text preview generation.
Defined in:
opal/input/autocomplete.crConstructors
Instance Method Summary
- #candidates(words : Array(String)) : self
- #candidates : Array(String)
-
#candidates(*words : String) : self
Adds candidate words for autocompletion
- #candidates=(candidates : Array(String))
-
#complete(query : String) : String
Returns the full completed string for the best match, or the query itself
-
#ghost_text(query : String) : String | Nil
Returns the ghost text suffix for the best match, or nil if no match Example: query "bu", match "build" -> returns "ild"
-
#match_mode(m : Symbol) : self
Sets matching mode (:prefix or :fuzzy)
-
#matches(query : String) : Array(String)
Returns all matching candidates for the current query
- #mode : Mode
- #mode=(mode : Mode)
-
#provider(&block : String -> Array(String)) : self
Adds a dynamic provider block generating suggestions based on query
Constructor Detail
Instance Method Detail
Returns the full completed string for the best match, or the query itself
Returns the ghost text suffix for the best match, or nil if no match Example: query "bu", match "build" -> returns "ild"
Adds a dynamic provider block generating suggestions based on query