Skip to content

`bynk-lsp`

The Bynk language server. The bynk-lsp crate builds the bynkc-lsp binary, a tower-lsp server that communicates over stdio. Editors talk to it; most users reach it through the VS Code extension rather than directly.

CapabilityNotes
DiagnosticsLive, from bynkc::diagnose (recovering compilation); published on change.
HoverType signatures and doc blocks; binding-correct via the project index (v0.25), with a name-match fallback for not-yet-indexed kinds.
Go-to-definitionTypes, functions, capabilities, services, agents; cross-file and binding-correct via the project index (v0.25).
ReferencesProject-wide, from the binding index (v0.25) — including clause lists and test units.
RenameProject-wide with prepareRename; validated by re-analysis + index equality, versioned edits (v0.25).
FormattingWhole-document and range formatting, via the shared bynk-fmt.
Document symbolsAn outline of the file for the editor’s symbol view.
File watchingRe-checks diagnostics when .bynk files change on disk.

Text is synced in full (TextDocumentSyncKind::FULL). When a project root with a bynk.toml is found, the server enables cross-file lookups; otherwise it works in single-file mode.

From the workspace root:

Terminal window
cargo build --release -p bynk-lsp

The binary is target/release/bynkc-lsp. Put it on PATH, or point your editor at it explicitly (in VS Code, the bynk.executablePath setting).

The crate is split into focused modules:

ModuleRole
main.rsServer entry point, Backend state, request dispatch.
position.rsByte-offset ↔ LSP position conversion.
symbols.rsSymbol lookups for hover and go-to-definition.
index_queries.rsPure queries over the project binding index: references, rename planning and validation (v0.25).
document_symbols.rsThe document-symbol outline.
project.rsbynk.toml project configuration.

Backend holds the project root, parsed config, and open documents behind a tokio::sync::RwLock.

The server logs to ~/.bynk-lsp.log; the verbosity is tunable via the BYNK_LSP_LOG environment variable. bynkc-lsp --version prints the version without entering the protocol loop.