class

Opal::Input::Autocomplete

Inherits Reference < Object

Autocompletion engine supporting static dictionaries, dynamic providers, and ghost text preview generation.

Constructors

new(candidates : Array(String) = [] of String)
Source

Instance methods

candidates(words : Array(String)) : self
Source
candidates
Source
candidates(*words : String) : self

Adds candidate words for autocompletion

Source
candidates=(candidates : Array(String))
Source
complete(query : String) : String

Returns the full completed string for the best match, or the query itself

Source
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"

Source
match_mode(m : Symbol) : self

Sets matching mode (:prefix or :fuzzy)

Source
matches(query : String) : Array(String)

Returns all matching candidates for the current query

Source
mode
Source
mode=(mode : Mode)
Source
provider

Adds a dynamic provider block generating suggestions based on query

Source

Nested types