mod context;
mod dispatcher;
mod documents;
mod error;
mod raw;
mod server;
mod transport;
pub mod types {
pub use lsp_types::*;
}
pub use context::Context;
pub use documents::{Document, Documents, PositionEncoding};
pub use error::{Error, LspError, Result};
pub use raw::{JsonRpcError, RawMessage, RequestId};
pub use server::LanguageServer;
pub use transport::{
StdioBuilder, StdioReader, StdioTransport, StdioWriter, Transport, TransportError,
TransportReader, TransportWriter, stdio,
};
pub use tokio_util::sync::CancellationToken;
pub const DEFAULT_CONCURRENCY_LIMIT: usize = 64;
pub async fn serve<S, T>(server: S, transport: T) -> Result<()>
where
S: LanguageServer,
T: Transport,
{
dispatcher::run(server, transport, DEFAULT_CONCURRENCY_LIMIT).await?;
Ok(())
}
pub async fn serve_with_limit<S, T>(server: S, transport: T, concurrency_limit: usize) -> Result<()>
where
S: LanguageServer,
T: Transport,
{
dispatcher::run(server, transport, concurrency_limit).await?;
Ok(())
}