State and rendering for LSP signature help tooltips.
When the user types ( or , inside a function call, a floating
window appears above the cursor showing the function signature with
the active parameter highlighted. Supports multiple overloaded
signatures with cycling via C-j/C-k.
Lifecycle
- User types
(or,in insert mode CompletionHandling.maybe_handle/4detects the trigger charactertextDocument/signatureHelprequest sent to LSP- Response parsed into
SignatureHelpstate - Rendered as an overlay in the Chrome stage
- Dismissed on
), Escape, or cursor movement outside the call
Summary
Functions
Returns the tooltip's outer rect {row, col, width, height} in screen cells.
Creates a new signature help state from an LSP SignatureHelp response.
Cycle to the next signature overload.
Cycle to the previous signature overload.
Types
A parsed parameter.
A parsed signature.
@type t() :: %MingaEditor.SignatureHelp{ active_parameter: non_neg_integer(), active_signature: non_neg_integer(), anchor_col: non_neg_integer(), anchor_row: non_neg_integer(), signatures: [signature()] }
Signature help state.
Functions
@spec box(t(), {pos_integer(), pos_integer()}, map()) :: MingaEditor.Layout.rect() | nil
Returns the tooltip's outer rect {row, col, width, height} in screen cells.
Same box render/3 paints into (border, anchor placement, viewport clamping
included), so the SurfaceRegistry registers the signature-help surface's rect
from the BEAM's own geometry. Returns nil when there is no signature to place.
@spec from_response(map(), non_neg_integer(), non_neg_integer()) :: t() | nil
Creates a new signature help state from an LSP SignatureHelp response.
Cycle to the next signature overload.
Cycle to the previous signature overload.