Documentation
¶
Overview ¶
Package codeaction renders nook's LSP code-action picker — a small bordered menu listing the actions the language server proposed at the cursor. The user picks one with the arrow keys and accepts with Enter; the host then applies the chosen action's workspace edit.
The popup is a pure value: the host owns when it appears and what items it carries. codeaction.Popup knows only how to navigate its own list and render a bordered menu at a requested width.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Popup ¶
type Popup struct {
// contains filtered or unexported fields
}
Popup is the immutable state of the code-action menu. New() returns an empty popup; WithItems re-arms it with a fresh result set and resets the selection.
func (Popup) Selected ¶
func (p Popup) Selected() (nooklsp.CodeActionItem, bool)
Selected returns the currently-highlighted action and true, or the zero value and false if the popup is empty or the highlighted action is disabled (the host should refuse to apply a disabled action).