Skip to main content

corsa_client/
lib.rs

1//! High-level client bindings for the Corsa stdio API.
2//!
3//! This crate wraps the raw transports and endpoint naming used by Corsa
4//! behind typed request/response helpers. In practice it is the main entry
5//! point when you want to:
6//!
7//! - spawn a Corsa worker process
8//! - initialize it once and reuse the session
9//! - create and reuse snapshots
10//! - ask type, symbol, and syntax questions through strongly typed helpers
11//! - attach filesystem callbacks for overlay-like workflows
12//!
13//! # Main Building Blocks
14//!
15//! - [`ApiClient`] manages a single worker process or pipe connection.
16//! - [`ApiSpawnConfig`] describes how that worker should be started.
17//! - [`ManagedSnapshot`] keeps snapshot handles alive and releases them on drop.
18//! - [`ApiProfile`] gives orchestrators a stable name for a spawn configuration.
19//!
20//! # Performance Model
21//!
22//! `corsa` does not try to out-compile Corsa itself. The win comes from
23//! session reuse, snapshot reuse, and cheaper transports such as sync msgpack.
24//! For docs and benchmarks around that trade-off, see the workspace guides.
25
26/// Re-exports shared error types used by the client APIs.
27pub mod error {
28    pub use corsa_core::{CorsaError, Result, RpcResponseError};
29}
30
31/// Re-exports low-level JSON-RPC helpers used by the stdio client transport.
32pub mod jsonrpc {
33    pub use corsa_jsonrpc::*;
34}
35
36/// Re-exports process-spawning primitives used to launch Corsa.
37pub mod process {
38    pub use corsa_core::{AsyncChildGuard, CorsaCommand};
39}
40
41/// Re-exports structured operational events used by the client configs.
42pub mod observability {
43    pub use corsa_core::{CorsaEvent, CorsaObserver, SharedObserver};
44}
45
46/// Re-exports shared LSP model types used by editor-style API responses.
47pub mod lsp_types {
48    pub use ::lsp_types::*;
49}
50
51pub use corsa_core::{CorsaError, CorsaEvent, CorsaObserver, Result, SharedObserver};
52
53#[path = "api/mod.rs"]
54/// Typed bindings for the Corsa stdio API surface.
55pub mod api;
56
57pub use api::*;