reovim_lsp/
lib.rs

1//! LSP client library for reovim text editor.
2//!
3//! This crate provides a Language Server Protocol client implementation
4//! following reovim's saturator pattern for non-blocking I/O.
5//!
6//! # Architecture
7//!
8//! The LSP client uses a background task (saturator) pattern:
9//! - `LspSaturator` runs in a `tokio::spawn` task and owns the LSP client
10//! - `DiagnosticCache` uses `ArcSwap` for lock-free reads from render thread
11//! - `mpsc::channel(1)` with `try_send()` provides non-blocking requests
12//!
13//! This ensures the render thread never blocks on LSP I/O.
14
15mod cache;
16mod client;
17mod jsonrpc;
18mod progress;
19mod progress_event;
20mod saturator;
21mod transport;
22
23pub use {
24    cache::{BufferDiagnostics, DiagnosticCache},
25    client::{Client, ClientConfig, ClientError, uri_from_path},
26    jsonrpc::{Error as JsonRpcError, Id, Message, Notification, Request, Response},
27    progress::{
28        ProgressParams, ProgressToken, WorkDoneProgressBegin, WorkDoneProgressEnd,
29        WorkDoneProgressReport, WorkDoneProgressValue,
30    },
31    progress_event::{LspProgressBegin, LspProgressEnd, LspProgressReport},
32    saturator::{LspRequest, LspSaturator, LspSaturatorHandle},
33    transport::Transport,
34};
35
36// Re-export commonly used lsp-types
37pub use lsp_types::{
38    Diagnostic, DiagnosticSeverity, GotoDefinitionResponse, Hover, HoverContents, InitializeParams,
39    InitializeResult, Location, MarkedString, MarkupContent, MarkupKind, Position, Range,
40    ServerCapabilities, TextDocumentIdentifier, TextDocumentPositionParams, Uri,
41};
42
43// Re-export url::Url for file:// URI handling
44pub use url::Url;