Documentation
¶
Overview ¶
Package completion provides auto-completion for commands and suggestions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArgSpec ¶
type ArgSpec struct {
Name string
Description string
Required bool
Options []string // Valid options if limited
}
ArgSpec describes a command argument.
type Command ¶
Command represents a slash command for completion.
func DefaultCommands ¶
func DefaultCommands() []Command
DefaultCommands returns the default set of slash commands.
type Completion ¶
type Completion struct {
Value string // The completed text
Display string // Display text (if different from value)
Description string // Optional description
MatchIndex int // Index where match starts
}
Completion represents a completion suggestion.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages multiple completion providers.
func (*Manager) Complete ¶
func (m *Manager) Complete(input string, cursorCol int) []Completion
Complete returns completions for the given input.
func (*Manager) RegisterCommand ¶
RegisterCommand registers a slash command.
func (*Manager) RegisterProvider ¶
RegisterProvider registers a completion provider.
type Provider ¶
type Provider interface {
Complete(prefix string) []Completion
}
Provider provides completion suggestions.
Click to show internal directories.
Click to hide internal directories.