mirror of
https://github.com/SilasMarvin/lsp-ai.git
synced 2025-12-22 08:54:25 +01:00
16 lines
358 B
Rust
16 lines
358 B
Rust
use lsp_server::ResponseError;
|
|
|
|
pub trait ToResponseError {
|
|
fn to_response_error(&self, code: i32) -> ResponseError;
|
|
}
|
|
|
|
impl ToResponseError for anyhow::Error {
|
|
fn to_response_error(&self, code: i32) -> ResponseError {
|
|
ResponseError {
|
|
code: -32603,
|
|
message: self.to_string(),
|
|
data: None,
|
|
}
|
|
}
|
|
}
|