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
consumesedges, 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, perunit_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, anddocumentHighlight. - 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 IRbynk-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 callonly), and the HTTP response set a route can actually answer with.
Structs§
- Context
Boundary Info - #855: same rationale as
ContextSequenceInfoabove — a plain re-export, sinceContextBoundaryInfo’s fields are already IDE-appropriate as-is. #855: the per-unit slice of resolution the wire-contract peek needs — seeProjectAnalysis::boundary_info. A sibling ofContextSequenceInfo, 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). - Context
Sequence Info - #846: re-exported rather than left as a raw
bynk_check::analysispath —bynk-lsplinksbynk-ide/bynk-check/bynk-syntaxdirectly and deliberately does not depend onbynk-emit(the whole-compiler crate); seebynk-lsp/Cargo.toml’s dependency comment. UnlikeRoots/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 — seeProjectAnalysis::sequence_info. Moved verbatim (Decision C, #1115) frombynk-emit/src/project/diagnostics.rs. - Diagnostic
- One diagnostic produced from a recovery-mode compile of a single file.
- File
Diagnostics - Per-file diagnostics from a whole-project analysis.
v0.24 (ADR 0052):
textis the analysed snapshot — positions must convert against it, not a newer buffer (the analyse→publish window is real). - Project
Diagnostics - v0.24: the result of
diagnose_project. Every discovered file appears infiles— clean files with an empty list — so a consumer can clear stale diagnostics.unattributedholds project-level diagnostics with no single owning file (group/cycle/directory validations).
Enums§
- Analysis
Roots - 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).overlaymaps 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
bynkccompiles, from the same manifest, through the same discovery. - discover_
files - Slice A: the
.bynkfiles these roots contain — the same discoverycompile_projectperforms,excludeand theout/node_modulescaches honoured. For enumerating a project’s units without analysing it. - renamed_
unit_ name - #302: the qualified name a file moved from
old_reltonew_relshould now declare, preserving whichever single-file/multi-file arrangementold_relused to satisfy againstold_name— for the LSP’sworkspace/willRenameFileshandler.