pub enum LspError {
NoLspAvailable,
Timeout {
operation: String,
timeout_ms: u64,
},
Protocol(String),
ConnectionLost,
UnsupportedCapability {
capability: String,
},
Io(Error),
}Expand description
Errors that the LSP engine can produce.
Variants§
NoLspAvailable
No language server is configured or available for this file type.
This is the expected error when Pathfinder is running without LSP support (i.e., in degraded mode). The calling tool handler should return a gracefully degraded response rather than propagating this error.
Timeout
The LSP server did not respond within the timeout window.
For initialization this is 30 seconds. For individual requests, it is configurable (default: 10s). Includes the operation name and timeout duration for structured logging.
Fields
Protocol(String)
The LSP server returned a JSON-RPC error response or sent malformed data.
The contained string is a human-readable description of the error, suitable for logging and agent-facing messages.
ConnectionLost
The LSP server process crashed or the connection was broken.
Triggers crash-recovery logic (exponential backoff, max 3 retries).
UnsupportedCapability
The LSP server is running but does not advertise the requested capability.
For example, a server that doesn’t implement Pull Diagnostics (LSP 3.17) will trigger this error for diagnostic queries. The tool handler should degrade gracefully and report the limitation to the caller.
Io(Error)
I/O error communicating with the LSP process.
Implementations§
Source§impl LspError
impl LspError
Sourcepub fn recovery_hint(&self) -> Option<String>
pub fn recovery_hint(&self) -> Option<String>
Returns an actionable recovery hint for the agent.
The hint tells agents what to do next — not just what went wrong.
All variants return Some; agents should surface these in tool
responses when validation or navigation degrades.
This is the LSP-layer equivalent of PathfinderError::hint().
Trait Implementations§
Source§impl Error for LspError
impl Error for LspError
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()
Auto Trait Implementations§
impl Freeze for LspError
impl !RefUnwindSafe for LspError
impl Send for LspError
impl Sync for LspError
impl Unpin for LspError
impl UnsafeUnpin for LspError
impl !UnwindSafe for LspError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more