Skip to main content

Crate bock_lsp

Crate bock_lsp 

Source
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§

BockLanguageServer
The Bock language server.
CheckResult
Result of running the check pipeline on a single document.
DefinitionResult
Result of a successful go-to-definition lookup.
HoverResult
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 None if the cursor is not over a resolved identifier.
format_type
Render a Type as 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 None if nothing useful can be said.
position_to_offset
Convert a 0-indexed LSP (line, character) position to a byte offset into content. 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 Severity to an LSP DiagnosticSeverity.
span_to_range
Convert a Bock Span to an LSP Range using the given source file for line/column lookup.
to_lsp_diagnostic
Convert a single Bock [Diagnostic] to its LSP representation.