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
Creates a new signature help state from an LSP SignatureHelp response.
Cycle to the next signature overload.
Cycle to the previous signature overload.
Renders the signature help as display list draws for an overlay.
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 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.
@spec render(t(), {pos_integer(), pos_integer()}, map()) :: [ MingaEditor.DisplayList.draw() ]
Renders the signature help as display list draws for an overlay.
Shows the active signature label with the active parameter highlighted. If there are multiple signatures, shows a "1/3" counter.