Skip to main content

Module symbols

Module symbols 

Source
Expand description

Symbol lookups for hover and go-to-definition.

Single-file lookups walk the parsed AST. Cross-file lookups (v1.1; LSP spec §3.4 cross-file requirement) iterate the project’s .bynk sources to find a declaration in any unit the user might be referencing — used when the open file lacks the symbol the user clicked on (typically because the name was imported via uses or made available via consumes).

Structs§

CrossFileSymbol
A cross-file declaration lookup result: the URI of the file containing the declaration, the declaration’s source span, and the full source text of that file (returned because callers need it to convert the span to an LSP range and to build hover content).

Functions§

describe_agent 🔒
describe_capability 🔒
describe_firstparty_symbol 🔒
Describe a symbol declared in the embedded first-party sources — the bynk and bynk.cloudflare adapters and the bynk.list/bynk.map/bynk.string stdlib. Hover and completion-doc resolution otherwise walk only the project’s files (walk_bynk_files), so stdlib/surface symbols had no surfaced signature or doc; this is the fallback after the project scan. Any --- doc block on a first-party declaration rides along (via describe_fn/describe_type/…), once the sources carry one.
describe_fn 🔒
describe_item 🔒
describe_provider 🔒
describe_service 🔒
describe_symbol
Build a Markdown summary of a named declaration suitable for an LSP hover response. Returns None if no declaration matches.
describe_symbol_cross_file
Markdown hover content for name from any project file other than current_uri, plus the URI of the file that contributed it. Returns None if the name is not declared anywhere in the project.
describe_type 🔒
find_declaration_cross_file
Find name’s declaration in any project file other than current_uri. Walks src_root recursively, parses each .bynk file with recovery, and returns the first hit. Returns None if the name is not found anywhere in the project.
find_declaration_span
Return the source span of the declaration named name in the given source text. Returns None if no declaration matches.
type_ref_str 🔒
unit_reference_spans 🔒
Slice 6b: the (unit name, name span) of every uses/consumes target in the source — the clickable ranges for document links. The link’s target file is resolved by the handler through the unit→source map (ADR 0095); this only finds the spans, so it works on the live buffer regardless of the map.
walk_bynk_files 🔒
Recursively collect every .bynk file under root. Returns an empty vector if the root is missing or unreadable.