Help us shape the future of Go! Take the 2026 Go Developer Survey

completion

package
v1.113.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppendItemsMsg

type AppendItemsMsg struct {
	Items []Item
}

AppendItemsMsg appends items to the current completion list without closing the popup. Useful for async loading of completion items.

type CloseMsg

type CloseMsg struct{}

type ClosedMsg

type ClosedMsg struct{}

type Item

type Item struct {
	Label       string
	Description string
	Value       string
	Execute     func() tea.Cmd
	Pinned      bool // Pinned items always appear at the top, in original order
	// Disabled marks an item that is shown for context but cannot be
	// submitted (e.g. a non-restartable toolset for /toolset-restart).
	// Enter/Tab are a no-op on it and it never drives the ghost-suggestion
	// preview; cursor movement over it is still allowed.
	Disabled bool
}

type Manager

type Manager interface {
	layout.Model

	GetLayers() []*lipgloss.Layer
	Open() bool
	// SetEditorBottom sets the height from the bottom of the screen where the editor ends.
	// This is used to position the completion popup above the editor.
	SetEditorBottom(height int)
}

Manager manages the dialog stack and rendering

func New

func New() Manager

New creates a new completion component

type MatchMode

type MatchMode int

MatchMode defines how completion items are filtered

const (
	// MatchFuzzy uses fuzzy matching (matches anywhere in label)
	MatchFuzzy MatchMode = iota
	// MatchPrefix requires the query to match the start of the label
	MatchPrefix
)

type OpenMsg

type OpenMsg struct {
	Items     []Item
	MatchMode MatchMode
}

type OpenedMsg

type OpenedMsg struct{}

type QueryMsg

type QueryMsg struct {
	Query string
}

type ReplaceItemsMsg

type ReplaceItemsMsg struct {
	Items []Item
}

ReplaceItemsMsg replaces non-pinned items in the completion list. Pinned items (like "Browse files…") are preserved. Useful for full async load that supersedes initial results.

type SelectedMsg

type SelectedMsg struct {
	Value      string
	Execute    func() tea.Cmd
	AutoSubmit bool
}

type SelectionChangedMsg

type SelectionChangedMsg struct {
	Value string
}

SelectionChangedMsg is sent when the selected item changes (for preview in editor)

type SetLoadingMsg

type SetLoadingMsg struct {
	Loading bool
}

SetLoadingMsg sets the loading state for the completion popup.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL