Expand description
Bock Language Server Protocol implementation.
Provides an LSP server over stdio that editors can connect to for diagnostics, hover, go-to-definition, and other Bock tooling features.
This crate exposes BockLanguageServer and a run_stdio entry point
used by bock-cli to launch the server.
Structs§
- Bock
Language Server - The Bock language server.
- Check
Result - Result of running the check pipeline on a single document.
- Definition
Result - Result of a successful go-to-definition lookup.
- Hover
Result - Result of a successful hover lookup.
Functions§
- check_
document - Run lex → parse → resolve → lower → type-check → analyze on a document.
- find_
definition - Run the minimum pipeline needed to answer a definition query and return
the declaration span at the cursor, or
Noneif the cursor is not over a resolved identifier. - format_
type - Render a
Typeas a single-line Bock-syntax string suitable for hover. - hover
- Run the minimum pipeline needed to answer a hover query and return the
type of the innermost node at the cursor, or
Noneif nothing useful can be said. - position_
to_ offset - Convert a 0-indexed LSP
(line, character)position to a byte offset intocontent. Column counts Unicode scalar values (matches the LSP UTF-16 default closely enough for Bock’s ASCII-dominant source, and exactly for pure-ASCII files). - run_
stdio - Launch the Bock LSP server over stdio.
- severity_
to_ lsp - Convert a Bock
Severityto an LSPDiagnosticSeverity. - span_
to_ range - Convert a Bock
Spanto an LSPRangeusing the given source file for line/column lookup. - to_
lsp_ diagnostic - Convert a single Bock [
Diagnostic] to its LSP representation.