pub enum ProtocolError {
ExpectedInitialize(String),
ExpectedInitialized(String),
Disconnected,
AfterShutdown(String),
InitializeTimeout,
RequestTimeout,
Io(Error),
}Expand description
Errors that occur during LSP protocol lifecycle management.
These errors represent violations of the LSP protocol’s initialization and shutdown sequences.
§Examples
use lsp_server_tokio::ProtocolError;
// Creating protocol errors
let err = ProtocolError::ExpectedInitialize("textDocument/hover".to_string());
assert!(err.to_string().contains("textDocument/hover"));
let err = ProtocolError::Disconnected;
assert!(err.to_string().contains("disconnected"));Variants§
ExpectedInitialize(String)
Expected initialize request, but received a different message.
This occurs when the server is in Uninitialized state and receives
a request other than initialize.
ExpectedInitialized(String)
Expected initialized notification, but received a different message.
This occurs when the server is in Initializing state and receives
a notification other than initialized.
Disconnected
The connection was disconnected unexpectedly.
This typically occurs when the client closes the connection without
sending an exit notification.
AfterShutdown(String)
Received a request after the shutdown request was processed.
After receiving shutdown, only the exit notification is valid.
InitializeTimeout
Timed out waiting for the initialized notification.
RequestTimeout
Timed out waiting for a response to a server-initiated request.
Io(Error)
An I/O error occurred during protocol communication.
Trait Implementations§
Source§impl Debug for ProtocolError
impl Debug for ProtocolError
Source§impl Display for ProtocolError
impl Display for ProtocolError
Source§impl Error for ProtocolError
impl Error for ProtocolError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()