pub mod client;
pub mod protocol;
pub mod server;
pub mod types;
pub use client::{LspClient, SyncLspClient};
pub use protocol::{
create_code_action_request, create_completion_request, create_definition_request,
create_did_change_notification, create_did_close_notification, create_did_open_notification,
create_document_highlight_request, create_document_symbol_request, create_formatting_request,
create_hover_request, create_initialize_request, create_references_request,
create_rename_request, create_signature_help_request, create_workspace_symbol_request,
LspMessage, LspNotification, LspRequest, LspResponse,
};
pub use server::{
clangd_config, gopls_config, pylance_config, pyright_config, rust_analyzer_config,
typescript_config, LanguageServer, LanguageServerConfig, LanguageServerManager,
};
pub use types::*;
#[derive(Debug, thiserror::Error)]
pub enum LspError {
#[error("LSP server not found for language: {0}")]
ServerNotFound(String),
#[error("LSP server initialization failed: {0}")]
InitializationFailed(String),
#[error("LSP request failed: {0}")]
RequestFailed(String),
#[error("LSP timeout")]
Timeout,
#[error("LSP server crashed: {0}")]
ServerCrashed(String),
#[error("Invalid LSP message: {0}")]
InvalidMessage(String),
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("JSON error: {0}")]
Json(#[from] serde_json::Error),
}
pub type LspResult<T> = std::result::Result<T, LspError>;