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 default documentation is the stable LSP 3.17 surface. APIs in the proposed module and proposed-only Client methods are explicitly marked unstable and appear only when the proposed feature is enabled.

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 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.
Client
A cloneable typed handle for messages sent to the current LSP client.
Context
Per-request handle to framework state (see ADR 0009).
Document
A single tracked text document (ADR 0005).
DocumentsView
The read-only view of the connection’s documents that Context::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.
OsFileProvider
The default FileProvider that reads file: URIs from the local filesystem.
OsFileProviderBuilder
Configures an OsFileProvider before it is built.
ProgressHandle
The connection-scoped handle for one work-done progress operation, created by Client::begin_progress.
ProgressOptions
Options for Client::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.
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).

Enums§

BuildError
A configuration error surfaced by ServerBuilder::build.
CallKind
Whether a normalized user call came from a request or a notification.
ClientError
A failure to enqueue a typed server-to-client operation.
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 (Client::begin_progress and the resulting ProgressHandle).
RawMessage
A validated JSON-RPC envelope with parameters and results retained as raw UTF-8 JSON bytes.
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).
DEFAULT_OUTBOUND_WARNING_THRESHOLD
Outbound queue depth at which the engine warns once per upward crossing when a Server does not set its own with ServerBuilder::outbound_warning_threshold.

Traits§

FileProvider
Supplies text for resources that are not open in the editor.
Layer
Adds cross-cutting behavior around normalized user dispatch.
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§

RequestId
A JSON-RPC request identifier accepted by LSP.
Result
Result type returned by serving and Transport entry points.
ServiceFuture
Boxed future returned by a user Layer.