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.

The public protocol surface follows the stable LSP 3.18 specification.

Re-exports§

pub use features::FeatureSpec;
pub use features::NotificationFeatureSpec;

Modules§

features
Standard LSP feature descriptors (ADR 0017).
types
LSP protocol types — re-exported from gen-lsp-types per ADR 0032.

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.
ChildConnection
An initialized Client connection that owns and supervises its stdio child.
ChildOutput
The terminal result of a supervised stdio language-server child.
Client
An LSP client endpoint configured for one connection.
ClientBuilder
Builder for one Client connection.
ClientConnection
A connected client endpoint and its remaining inbound driver.
ClientContext
Per-call handle passed to server-to-client handlers.
ClientHandle
A cloneable typed handle for messages sent to the current LSP client.
ConnectionFailure
One connection-level failure delivered to ServerBuilder::on_error.
ConnectionFailureContext
Non-sensitive identity attached to a connection failure when available.
Document
A single tracked text document (ADR 0005).
DocumentsView
The read-only view of the connection’s documents that ServerContext::documents hands to user code (ADR 0018).
IncomingCall
A validated, decoded call at the user Layer boundary.
InitializeRegistrar
The transactional registrar handed to configure_initialize (ADR 0017).
JsonRpcError
A JSON-RPC error object.
MemoryFileProvider
An in-memory FileProvider intended for tests and virtual resources.
Next
The next inner Service in a user Layer chain.
Notebook
A snapshot of one synchronized notebook.
NotebooksView
Read-only access to the synchronized notebooks owned by one connection.
OsFileProvider
The default FileProvider that reads file: URIs from the local filesystem.
OsFileProviderBuilder
Configures an OsFileProvider before it is built.
PartialResultSink
A request-scoped, typed destination for partial result chunks.
ProgressHandle
The connection-scoped handle for one work-done progress operation, created with a server-allocated token by ClientHandle::begin_progress or with the inbound request’s token by ServerContext::begin_progress.
ProgressOptions
Options for ClientHandle::begin_progress, mapped verbatim onto the work-done begin notification.
ResourcePolicy
Finite budgets for resources owned by one LSP connection.
Server
Owns exactly one LSP connection: its application state, the static registrations awaiting the initialize transaction, the optional initialization-dependent callback, and the lifecycle hooks (on_initialize, on_initialized, on_shutdown, on_exit) (ADR 0017, ADR 0018). A second connection requires a second Server; connection state is never shared between servers.
ServerBuilder
Collects static registrations for one connection before handing them to a Server (ADR 0017). Registration mistakes are recorded and surfaced by build; the builder methods stay chainable.
ServerContext
Per-request handle to framework state (see ADR 0009).
ServerHandle
A cloneable typed handle for messages sent to the connected LSP server.
StdioBuilder
A default-stdio Server builder ready to be served.
StdioReader
Read half of StdioTransport.
StdioTransport
A Content-Length framed Transport over process standard input and output.
StdioWriter
Write half of StdioTransport.
Workspace
Cloneable handle to the connection’s workspace state (ADR 0017, ADR 0034).

Enums§

BuildError
A configuration error surfaced by ServerBuilder::build.
CallKind
Whether a normalized user call came from a request or a notification.
ChildError
A failure while building, launching, driving, or reclaiming a stdio child.
ClientError
A typed peer operation or client-endpoint lifecycle transition failed.
ConnectionDirection
The direction in which a reported connection failure occurred.
ConnectionFailureCategory
A stable class of connection-level failure observed by an error hook.
ConnectionRequestId
Non-sensitive identity for a JSON-RPC request.
Error
A terminal framework or Transport failure while serving a connection.
LspError
A JSON-RPC/LSP error suitable for returning from a handler.
Outcome
How one connection ended.
PositionEncoding
Negotiated meaning of Position.character (ADR 0016).
ProgressError
A failure of the connection-scoped work-done progress lifecycle (ClientHandle::begin_progress and the resulting ProgressHandle).
RawMessage
A validated JSON-RPC envelope with parameters and results retained as raw UTF-8 JSON bytes.
RequestId
A JSON-RPC request identifier accepted by LSP.
ResourcePolicyField
A field whose value made a ResourcePolicy invalid.
ServiceResult
The only outcomes of normalized user dispatch.
TelemetryEventParams
The payload of a telemetry/event notification.
TransportError
A Transport framing, channel, or serialization failure.
WorkspaceError
Failure to resolve a document through the connection’s workspace.

Constants§

DEFAULT_CONCURRENCY_LIMIT
Cap on calls in flight inside the user Layer chain when a Server does not set its own with ServerBuilder::concurrency_limit (ADR 0012).

Traits§

FileProvider
Supplies text for resources that are not open in the editor.
Layer
Adds cross-cutting behavior around normalized user dispatch.
PartialResultRequest
A standard LSP request whose metaModel entry defines a partial result.
SharedHandler
One target-aware erasure boundary for handlers shared by runtime tasks.
TaskFuture
A type-erased future that preserves the target’s task mobility bound.
TaskSend
Target-dependent task mobility bound.
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§

stdio
Entry point: serve a built Server over the default stdio adapter.

Type Aliases§

Result
Result type returned by serving and Transport entry points.
ServiceFuture
Boxed future returned by a user Layer.