Crate reovim_lsp

Crate reovim_lsp 

Source
Expand description

LSP client library for reovim text editor.

This crate provides a Language Server Protocol client implementation following reovim’s saturator pattern for non-blocking I/O.

§Architecture

The LSP client uses a background task (saturator) pattern:

  • LspSaturator runs in a tokio::spawn task and owns the LSP client
  • DiagnosticCache uses ArcSwap for lock-free reads from render thread
  • mpsc::channel(1) with try_send() provides non-blocking requests

This ensures the render thread never blocks on LSP I/O.

Structs§

BufferDiagnostics
Per-buffer diagnostic data.
Client
LSP client.
ClientConfig
LSP client configuration.
Diagnostic
Represents a diagnostic, such as a compiler error or warning. Diagnostic objects are only valid in the scope of a resource.
DiagnosticCache
Lock-free diagnostic cache.
DiagnosticSeverity
The protocol currently supports the following diagnostic severities:
Hover
The result of a hover request.
InitializeParams
InitializeResult
JsonRpcError
A JSON-RPC error.
Location
Represents a location inside a resource, such as a line inside a text file.
LspProgressBegin
LSP progress started
LspProgressEnd
LSP progress completed
LspProgressReport
LSP progress update
LspSaturator
LSP saturator - background task that owns the LSP client.
LspSaturatorHandle
Handle for sending requests to the saturator.
MarkupContent
A MarkupContent literal represents a string value which content can be represented in different formats. Currently plaintext and markdown are supported formats. A MarkupContent is usually used in documentation properties of result literals like CompletionItem or SignatureInformation. If the format is markdown the content should follow the GitHub Flavored Markdown Specification.
Notification
A JSON-RPC notification (no response expected).
Position
Position in a text document expressed as zero-based line and character offset. A position is between two characters like an ‘insert’ cursor in a editor.
ProgressParams
Progress notification params for $/progress
Range
A range in a text document expressed as (zero-based) start and end positions. A range is comparable to a selection in an editor. Therefore the end position is exclusive.
Request
A JSON-RPC request.
Response
A JSON-RPC response.
ServerCapabilities
TextDocumentIdentifier
Text documents are identified using a URI. On the protocol level, URIs are passed as strings.
TextDocumentPositionParams
A parameter literal used in requests to pass a text document and a position inside that document.
Transport
Transport for LSP communication.
Uri
Newtype struct around fluent_uri::Uri<String> with serialization implementations that use as_str() and ‘from_str()’ respectively.
Url
A parsed URL record.
WorkDoneProgressBegin
Begin progress notification
WorkDoneProgressEnd
End progress notification
WorkDoneProgressReport
Report progress notification

Enums§

ClientError
Error type for client operations.
GotoDefinitionResponse
GotoDefinition response can be single location, or multiple Locations or a link.
HoverContents
Hover contents could be single entry or multiple entries.
Id
JSON-RPC request/response ID.
LspRequest
Request types that can be sent to the saturator.
MarkedString
MarkedString can be used to render human readable text. It is either a markdown string or a code-block that provides a language and a code snippet. The language identifier is semantically equal to the optional language identifier in fenced code blocks in GitHub issues.
MarkupKind
Describes the content type that a client supports in various result literals like Hover, ParameterInfo or CompletionItem.
Message
A JSON-RPC message (request, response, or notification).
ProgressToken
Progress token (can be string or number)
WorkDoneProgressValue
Work done progress value (begin/report/end)

Functions§

uri_from_path
Convert a file path to a lsp_types::Uri.