Skip to main content

Crate lspf

Crate lspf 

Source
Expand description

lspf — a Rust framework for building extensible LSP language servers.

See CONTEXT.md and docs/adr/ at the repository root for the domain language and the architectural decisions that shape this crate.

Modules§

types
LSP protocol types — re-exported from lsp-types per ADR 0014.

Structs§

CancellationToken
Cancellation primitive passed to every request handler (ADR 0007). A token which can be used to signal a cancellation request to one or more tasks.
Context
Per-request handle to framework state (see ADR 0009).
Document
A single tracked text document (ADR 0005).
Documents
Concurrency-safe handle to every tracked Document (ADR 0003).
JsonRpcError
StdioBuilder
StdioReader
StdioTransport
StdioWriter

Enums§

Error
LspError
PositionEncoding
Negotiated meaning of Position.character (ADR 0016).
RawMessage
TransportError

Constants§

DEFAULT_CONCURRENCY_LIMIT
Default cap on in-flight handler tasks (ADR 0012).

Traits§

LanguageServer
The user’s language server (see ADR 0003, 0004, 0006, 0007, 0009).
Transport
A message-framed channel for LSP JSON-RPC envelopes (see ADR 0011).
TransportReader
Read half of a Transport (ADR 0011, ADR 0015).
TransportWriter
Write half of a Transport (ADR 0011, ADR 0015). shutdown consumes the writer so the send-loop task can flush remaining bytes after the outgoing channel is drained.

Functions§

serve
Drive a LanguageServer over a custom Transport.
serve_with_limit
Like serve, but with an explicit cap on in-flight handler tasks (ADR 0012). When the cap is hit, the read-loop awaits a permit before spawning the next handler — visible in traces as a long handler.acquire_permit span.
stdio
Entry point: wrap a LanguageServer in the default stdio adapter.

Type Aliases§

RequestId
Result