Expand description
v0.32 (ADR 0065): signature help — textDocument/signatureHelp.
While typing a call’s arguments, show the callee’s signature with the active
parameter highlighted. Call-context detection is lexical (the innermost
unclosed ( before the cursor, the callee before it, the active parameter
from a bracket-aware comma count); signatures are semantic, resolved from
the recovery parse + the static registries — the same name-vs-value split as
completion. This slice covers name callees: free functions, capability
operations, refined/opaque of/unsafe, built-in type statics
(Int.parse/Json.decode), and the Ok/Err/Some constructors. Value
receivers (xs.fold() need the receiver typed → a later slice.
The signature is rendered with symbols::type_ref_str — the same Bynk-syntax
renderer hover uses — so the two never diverge.
Structs§
- Call
Context - The call under the cursor: the callee text, the active-parameter index, and
the byte offset of the call’s opening
(.
Functions§
- base_
name 🔒 - call_
context - The innermost unclosed
(beforeoffset, its callee, and the active parameter (top-level commas between that(and the cursor).Nonewhen the cursor is not inside a call’s argument list. - callee_
before 🔒 - The callee immediately before the
(— a barenameorRecv.member. - innermost_
unclosed_ 🔒paren - Scan back for the
(that is open at the cursor. A depth-0[or{means the cursor sits in a type-argument list / list literal / block, not a call. - kernel_
method_ signature - The kernel-method signature for
methodon receiver typety, if any. - param_
ranges - The byte ranges of each top-level parameter within a signature
label(name(p0, p1, …) -> R) — for the LSPParameterInformationoffsets. - push_
trimmed 🔒 - resolve_
label - Render the signature label for a name callee —
name(p: T, …) -> R.Noneif the callee can’t be resolved (or is a value receiver — slice 2). - resolve_
qualified 🔒 - top_
level_ 🔒commas - Top-level (bracket-depth-0) commas in
s. - value_
receiver_ method - A value-receiver method callee —
recv.methodwhererecvis a single lowercase-initial identifier (a value, not a type/capability name). The signature comes from typing the receiver (a later slice’s path). - value_
receiver_ rewrite - For a value-receiver callee
recv.method(whose(is atopen_paren, rewrite the buffer sorecvis a complete expression (the.method(argsdropped) and return it with the receiver byte offset to type — the same mid-edit trick value-member completion uses.