Expand description
bynkc-lsp — Bynk Language Server.
Implements the LSP capabilities listed in design/bynk-lsp-spec.md §4.3:
synchronisation (Full), diagnostics, hover, go-to-definition and -type/-impl,
formatting, document symbols, completion, signature help, references, rename,
code actions, code lens, call hierarchy, document links, inlay hints,
semantic tokens, workspace symbols, real multi-root workspace folders, and
server-registered file watching. Built on tower-lsp.
Architecture:
Backendholds the server state (behind atokio::sync::RwLock): a map of projects keyed by discovered root — each with its own config, analysis round, and published set — plus the workspace-folder discovery seeds and the client-global map of open documents. A request routes by URI to its project (its nearest enclosingbynk.toml); a file under none is single-file.- Document changes trigger
schedule_diagnostics, one generation-based debounce (a project-wide round viabynk_ide::diagnose_project_with, or single-filebynk_ide::diagnose) that publishes the resulting diagnostics. - Hover and definition consult the parsed AST for the file under the cursor; both are best-effort (return None for unrecognised positions).
- Formatting delegates to
bynk_fmt::format_source.
Slice C (the [lib] seam): this crate exposes a library target so its
integration tests can use bynk_lsp::… instead of #[path]-including source
modules. The pub mods below are exposed for that testing, not as a
stable API — bynk-lsp is a language-server binary and makes no library
compatibility promise.
Modules§
- architecture_
request - #851:
bynk/architectureModel— the architecture-map custom LSP request. - capability_
fixes - #852 (capability-aware quick-fixes): the
codeActionproducers that repair resolution/boundary diagnostics by editing a unit’s header —add consumesfor an unconsumed cross-context call, and the Bynk analogue of auto-import (add uses/add consumes) for an unresolved name that the binding index places in a mixable commons or a consumable context. - code_
actions - v0.26 (ADR 0054): pure
codeActioncomputation — quick-fixes from the structuredbynk_syntax::error::Suggestions riding on a cached analysis round’s diagnostics. - completion
- Re-exports
bynk-ide’s completion logic (#808) — moved there so it’s reachable frombynk-wasmtoo, which can’t depend on this crate’stower-lsp/tokiostack. Seebynk_ide::completionfor the real module. - documentation_
request - #847:
bynk/documentationModel— the documentation-view custom LSP request. - hover
- #611 (ADR 0190): hover’s resolution ladder, as one pure function.
- index_
queries - v0.25 (ADR 0053): pure queries over the project binding index.
- position
- Byte-offset ↔ LSP position conversion.
- sequence_
request - #846:
bynk/sequenceModel— the sequence-diagram custom LSP request. - symbols
- Re-exports
bynk-ide’s symbol logic (#808) — moved there so it’s reachable frombynk-wasmtoo, which can’t depend on this crate’stower-lsp/tokiostack. Seebynk_ide::symbolsfor the real module. - wire_
contract_ request - #855:
bynk/wireContract— the wire-contract-peek custom LSP request.
Structs§
Functions§
- run
- Slice C: the server’s entry point, moved out of
main.rsso the crate has a[lib]target.main.rsis now a thin shim over this.