Skip to main content

Module signature_help

Module signature_help 

Source
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§

CallContext
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 ( before offset, its callee, and the active parameter (top-level commas between that ( and the cursor). None when the cursor is not inside a call’s argument list.
callee_before 🔒
The callee immediately before the ( — a bare name or Recv.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 method on receiver type ty, if any.
param_ranges
The byte ranges of each top-level parameter within a signature label (name(p0, p1, …) -> R) — for the LSP ParameterInformation offsets.
push_trimmed 🔒
resolve_label
Render the signature label for a name callee — name(p: T, …) -> R. None if 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.method where recv is 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 at open_paren, rewrite the buffer so recv is a complete expression (the .method(args dropped) and return it with the receiver byte offset to type — the same mid-edit trick value-member completion uses.