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-typesper ADR 0014.
Structs§
- Cancellation
Token - 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). - Json
RpcError - Stdio
Builder - Stdio
Reader - Stdio
Transport - Stdio
Writer
Enums§
- Error
- LspError
- Position
Encoding - Negotiated meaning of
Position.character(ADR 0016). - RawMessage
- Transport
Error
Constants§
- DEFAULT_
CONCURRENCY_ LIMIT - Default cap on in-flight handler tasks (ADR 0012).
Traits§
- Language
Server - 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).
- Transport
Reader - Read half of a
Transport(ADR 0011, ADR 0015). - Transport
Writer - Write half of a
Transport(ADR 0011, ADR 0015).shutdownconsumes the writer so the send-loop task can flush remaining bytes after the outgoing channel is drained.
Functions§
- serve
- Drive a
LanguageServerover a customTransport. - 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 longhandler.acquire_permitspan. - stdio
- Entry point: wrap a
LanguageServerin the default stdio adapter.