tokio_lsp/lib.rs
1//! # tokio-lsp
2//!
3//! A Language Server Protocol (LSP) client implementation in Rust.
4//!
5//! This crate provides a lightweight, async-first LSP client that can be integrated
6//! into text editors and IDEs. It implements the LSP 3.16 specification and focuses
7//! on providing a clean, safe API for communicating with language servers.
8//!
9//! ## Features
10//!
11//! - Full LSP 3.16 specification support
12//! - Async/await interface using tokio
13//! - Type-safe message handling with serde
14//! - Comprehensive error handling
15//! - Transport layer abstraction
16//!
17//! ## Example
18//!
19//! ```rust,no_run
20//! use tokio_lsp::Client;
21//! use tokio::process::{ChildStdin, ChildStdout};
22//! use std::io::Cursor;
23//!
24//! #[tokio::main]
25//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
26//! // Example using mock streams
27//! let reader = Cursor::new(vec![]);
28//! let writer = Cursor::new(Vec::new());
29//! let client = Client::new(reader, writer);
30//! // In real usage, you'd connect to a language server process
31//! // and use its stdin/stdout for reader/writer
32//! Ok(())
33//! }
34//! ```
35
36pub mod client;
37pub mod error;
38pub mod transport;
39pub mod types;
40
41pub use client::Client;
42pub use error::{LspError, Result};
43
44/// Re-export commonly used types
45pub mod prelude {
46 pub use crate::client::Client;
47 pub use crate::error::{LspError, Result};
48 pub use crate::types::*;
49}