Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var OnAutoComplete util.Hook[AutoCompleteRequest]
OnAutoComplete is fired after the built-in autocomplete logic has run. Modules register handlers here to contribute completions for their own commands. Each handler receives the current request (including any results already accumulated by earlier handlers), may append to Results, and must return the modified value.
Example registration from a module:
suggestions.OnAutoComplete.Register(func(r suggestions.AutoCompleteRequest) suggestions.AutoCompleteRequest {
if r.Cmd != "mycommand" {
return r
}
// ... append to r.Results ...
return r
})
Functions ¶
func GetAutoComplete ¶ added in v0.9.8
GetAutoComplete returns a list of completion suffixes for the given partial input text. Each entry is the text that should be appended to inputText to form a complete suggestion. The results are sorted shortest-first.
Types ¶
type AutoCompleteRequest ¶ added in v0.9.8
AutoCompleteRequest is the value threaded through OnAutoComplete handlers. Cmd is the resolved command (after alias expansion). Parts is the original whitespace-split input slice. UserId identifies the requesting player. Results is the accumulated completion suffix list; handlers append to it.
type Suggestions ¶
type Suggestions struct {
// contains filtered or unexported fields
}
func (*Suggestions) Clear ¶
func (s *Suggestions) Clear()
func (*Suggestions) Count ¶
func (s *Suggestions) Count() int
func (*Suggestions) Next ¶
func (s *Suggestions) Next() string
func (*Suggestions) Set ¶
func (s *Suggestions) Set(suggestions []string)