#![cfg_attr(
all(not(target_arch = "wasm32"), not(feature = "runtime-tokio")),
allow(dead_code)
)]
#[cfg(all(target_arch = "wasm32", not(feature = "wasm")))]
compile_error!(
"the wasm32 target requires the `wasm` feature; \
build with `--no-default-features --features worker-channel`, \
or `--no-default-features --features wasm` plus your transports"
);
#[cfg(all(feature = "worker-channel", not(target_arch = "wasm32")))]
compile_error!("the `worker-channel` feature requires the wasm32 target");
#[cfg(all(target_arch = "wasm32", feature = "tcp"))]
compile_error!("the `tcp` feature is not supported on the wasm32 target");
#[cfg(all(target_arch = "wasm32", feature = "websocket"))]
compile_error!("the `websocket` feature is not supported on the wasm32 target");
mod builder;
mod capability;
mod client;
mod codec;
mod context;
mod documents;
#[cfg(any(feature = "runtime-tokio", target_arch = "wasm32"))]
mod engine;
mod error;
pub mod features;
mod file_provider;
mod progress;
#[cfg(feature = "proposed")]
pub mod proposed;
mod raw;
mod runtime;
mod service;
mod sync;
mod transport;
mod uri_key;
mod workspace;
#[cfg(all(test, not(target_arch = "wasm32")))]
mod test_util;
pub mod types {
pub use lsp_types::*;
}
#[cfg(doctest)]
mod markdown {
#[doc = include_str!("../../../README.md")]
pub struct Readme;
#[doc = include_str!("../../../README.zh-CN.md")]
pub struct ReadmeZhCn;
#[doc = include_str!("../../../docs/guides/features-and-workspace.md")]
pub struct FeaturesAndWorkspaceGuide;
#[doc = include_str!("../../../docs/guides/outgoing-client.md")]
pub struct OutgoingClientGuide;
#[doc = include_str!("../../../docs/guides/migrating-to-0.4.md")]
pub struct MigratingTo04Guide;
#[doc = include_str!("../../../docs/guides/transports.md")]
pub struct TransportsGuide;
}
#[doc(hidden)]
pub use builder::SharedHandler;
pub use builder::{InitializeRegistrar, Server, ServerBuilder};
pub use client::{Client, TelemetryEventParams};
pub use context::Context;
pub use documents::{Document, DocumentsView, PositionEncoding};
#[cfg(any(feature = "runtime-tokio", target_arch = "wasm32"))]
pub use engine::Outcome;
pub use error::{BuildError, ClientError, Error, LspError, ProgressError, Result};
pub use features::{FeatureSpec, NotificationFeatureSpec};
#[cfg(target_arch = "wasm32")]
pub use file_provider::EmptyFileProvider;
pub use file_provider::{FileProvider, MemoryFileProvider};
#[cfg(all(not(target_arch = "wasm32"), feature = "runtime-tokio"))]
pub use file_provider::{OsFileProvider, OsFileProviderBuilder};
pub use progress::{ProgressHandle, ProgressOptions};
pub use raw::{JsonRpcError, RawMessage, RequestId};
#[doc(hidden)]
pub use runtime::{TaskFuture, TaskSend};
pub use service::{CallKind, IncomingCall, Layer, Next, ServiceFuture, ServiceResult};
#[cfg(all(feature = "stdio", not(target_arch = "wasm32")))]
pub use transport::{StdioBuilder, StdioReader, StdioTransport, StdioWriter, stdio};
#[cfg(all(feature = "tcp", not(target_arch = "wasm32")))]
pub use transport::{TcpBuilder, TcpReader, TcpTransport, TcpWriter, tcp};
pub use transport::{Transport, TransportError, TransportReader, TransportWriter};
#[cfg(all(feature = "websocket", not(target_arch = "wasm32")))]
pub use transport::{
WebSocketBuilder, WebSocketReader, WebSocketTransport, WebSocketWriter, websocket,
};
#[cfg(all(feature = "worker-channel", target_arch = "wasm32"))]
pub use transport::{
WorkerChannelBuilder, WorkerChannelReader, WorkerChannelTransport, WorkerChannelWriter,
worker_channel,
};
pub use workspace::{Workspace, WorkspaceError};
pub use tokio_util::sync::CancellationToken;
pub const DEFAULT_CONCURRENCY_LIMIT: usize = 64;
pub const DEFAULT_OUTBOUND_WARNING_THRESHOLD: usize = 1024;