Skip to main content

Crate bynk_ide

Crate bynk_ide 

Source
Expand description

Bynk’s IDE/LSP analysis surface.

The non-bailing diagnostics the language server consumes — single-file (diagnose) and whole-project (diagnose_project_with, with diagnose_project the single-tree convenience) — plus the result types (Diagnostic, FileDiagnostics, ProjectDiagnostics). These are queries over the captured tables produced during analysis (the binding index, inlay hints, expression types, locals — all in bynk-check); the project analysis itself (bynk_check::analysis::analyse_project) is the non-bailing counterpart to compile_project.

Extracted from bynkc as slice 5 of the crate-decomposition track over bynk-syntax + bynk-check + bynk-emit (P4.2, #1122: this crate no longer depends on bynk-emit at all — it reaches bynk-check and bynk-project directly). Behaviour is unchanged; the language server (bynk-lsp) depends on this crate directly instead of the whole bynkc compiler crate, and bynkc re-exports these items so its own tests and public API are unchanged.

Modules§

architecture
#851: the architecture-model query — a whole-project map of contexts and adapters, their consumes edges, and the capabilities/providers/services/ agents each one binds, for the “Show Architecture Map” VS Code webview. The macro counterpart to #846’s per-handler sequence diagram: where that query is file-scoped and cursor-anchored, this one is project-scoped — every span here is paired with the project-relative file it belongs to (a unit’s declarations may span several files, per unit_sources), so a wire layer can open the right file on click-to-code rather than assuming the request’s own document.
completion
Completion for the cursor, keyed off the line up to it.
documentation
#847: the documentation-model query — a file’s declarations aggregated into a rendered reference page (“live rustdoc for Bynk”), for the VS Code “Show Documentation” webview.
locals_nav
v0.31 (ADR 0064): locals navigation — resolve the local binding under the cursor and all its sites (its definition plus every use that resolves to it), for references, go-to-definition, and documentHighlight.
sequence
#846: the sequence-diagram query.
signature_help
v0.32 (ADR 0065): signature help — textDocument/signatureHelp.
symbols
Symbol lookups for hover and go-to-definition.
wire_contract
#855: the wire-contract peek — the model behind “hover a service handler” and “Show Wire Contract”. Renders bynk_check::wire::WireModel (the same IR bynk-emit’s codec generation consumes) narrowed to one handler, plus the facts the IR does not carry: the request envelope shape, the cross-context contract form + hash (on call only), and the HTTP response set a route can actually answer with.

Structs§

ContextBoundaryInfo
#855: same rationale as ContextSequenceInfo above — a plain re-export, since ContextBoundaryInfo’s fields are already IDE-appropriate as-is. #855: the per-unit slice of resolution the wire-contract peek needs — see ProjectAnalysis::boundary_info. A sibling of ContextSequenceInfo, not a field on it: that struct is named and documented for #846, and this is a separate retained table serving a separate query (hover/panel over a single handler’s boundary, not the sequence-diagram classifier). Moved verbatim (Decision C, #1115).
ContextSequenceInfo
#846: re-exported rather than left as a raw bynk_check::analysis path — bynk-lsp links bynk-ide/bynk-check/bynk-syntax directly and deliberately does not depend on bynk-emit (the whole-compiler crate); see bynk-lsp/Cargo.toml’s dependency comment. Unlike Roots/ AnalysisRoots (which the IDE layer re-shapes because the raw type carries build-only concerns), ContextSequenceInfo’s fields are already IDE-appropriate as-is, so this is a plain re-export rather than a lowering. #846: the per-unit slice of resolution the sequence-diagram classifier needs — see ProjectAnalysis::sequence_info. Moved verbatim (Decision C, #1115) from bynk-emit/src/project/diagnostics.rs.
Diagnostic
One diagnostic produced from a recovery-mode compile of a single file.
FileDiagnostics
Per-file diagnostics from a whole-project analysis. v0.24 (ADR 0052): text is the analysed snapshot — positions must convert against it, not a newer buffer (the analyse→publish window is real).
ProjectDiagnostics
v0.24: the result of diagnose_project. Every discovered file appears in files — clean files with an empty list — so a consumer can clear stale diagnostics. unattributed holds project-level diagnostics with no single owning file (group/cycle/directory validations).

Enums§

AnalysisRoots
Slice A: which trees a project’s analysis walks.

Functions§

diagnose
Best-effort single-file compilation that always returns diagnostics.
diagnose_project
v0.24 (ADR 0052): non-bailing, overlay-aware, file-attributed project diagnostics — the LSP analysis entry point, distinct from compile_project (which bails and emits). overlay maps canonicalised absolute paths to buffer text layered over disk reads.
diagnose_project_with
Slice A: project diagnostics over manifest-resolved roots — the LSP analyses exactly the files bynkc compiles, from the same manifest, through the same discovery.
discover_files
Slice A: the .bynk files these roots contain — the same discovery compile_project performs, exclude and the out/node_modules caches honoured. For enumerating a project’s units without analysing it.
renamed_unit_name
#302: the qualified name a file moved from old_rel to new_rel should now declare, preserving whichever single-file/multi-file arrangement old_rel used to satisfy against old_name — for the LSP’s workspace/willRenameFiles handler.