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:
LspSaturatorruns in atokio::spawntask and owns the LSP clientDiagnosticCacheusesArcSwapfor lock-free reads from render threadmpsc::channel(1)withtry_send()provides non-blocking requests
This ensures the render thread never blocks on LSP I/O.
Structs§
- Buffer
Diagnostics - Per-buffer diagnostic data.
- Client
- LSP client.
- Client
Config - 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.
- Diagnostic
Cache - Lock-free diagnostic cache.
- Diagnostic
Severity - The protocol currently supports the following diagnostic severities:
- Hover
- The result of a hover request.
- Initialize
Params - Initialize
Result - Json
RpcError - A JSON-RPC error.
- Location
- Represents a location inside a resource, such as a line inside a text file.
- LspProgress
Begin - LSP progress started
- LspProgress
End - LSP progress completed
- LspProgress
Report - LSP progress update
- LspSaturator
- LSP saturator - background task that owns the LSP client.
- LspSaturator
Handle - Handle for sending requests to the saturator.
- Markup
Content - A
MarkupContentliteral represents a string value which content can be represented in different formats. Currentlyplaintextandmarkdownare supported formats. AMarkupContentis usually used in documentation properties of result literals likeCompletionItemorSignatureInformation. If the format ismarkdownthe 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.
- Progress
Params - 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.
- Server
Capabilities - Text
Document Identifier - Text documents are identified using a URI. On the protocol level, URIs are passed as strings.
- Text
Document Position Params - 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 useas_str()and ‘from_str()’ respectively. - Url
- A parsed URL record.
- Work
Done Progress Begin - Begin progress notification
- Work
Done Progress End - End progress notification
- Work
Done Progress Report - Report progress notification
Enums§
- Client
Error - Error type for client operations.
- Goto
Definition Response - GotoDefinition response can be single location, or multiple Locations or a link.
- Hover
Contents - 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.
- Marked
String - 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.
- Markup
Kind - Describes the content type that a client supports in various
result literals like
Hover,ParameterInfoorCompletionItem. - Message
- A JSON-RPC message (request, response, or notification).
- Progress
Token - Progress token (can be string or number)
- Work
Done Progress Value - Work done progress value (begin/report/end)
Functions§
- uri_
from_ path - Convert a file path to a
lsp_types::Uri.