pub struct RewrittenServerError { /* private fields */ }Expand description
The raw LSP error behind a position-out-of-range rewrite, carried as the
JSON-RPC data of the resulting -32602 error.
Error::LspServerError’s Display replaces rust-analyzer’s internal
“Invalid offset” text with a clean message; this keeps the original
reachable for the caller. The fields are private so the message can only
be built through Self::new, which bounds it.
§Examples
use mcpls_core::error::RewrittenServerError;
let raw = RewrittenServerError::new(-32603, "Invalid offset LineCol { line: 9, col: 0 }");
assert_eq!(raw.code(), -32603);
assert_eq!(
serde_json::to_value(&raw).unwrap(),
serde_json::json!({"code": -32603, "raw_message": "Invalid offset LineCol { line: 9, col: 0 }"})
);Implementations§
Source§impl RewrittenServerError
impl RewrittenServerError
Trait Implementations§
Source§impl Clone for RewrittenServerError
impl Clone for RewrittenServerError
Source§impl Debug for RewrittenServerError
impl Debug for RewrittenServerError
impl Eq for RewrittenServerError
Source§impl PartialEq for RewrittenServerError
impl PartialEq for RewrittenServerError
Source§impl Serialize for RewrittenServerError
impl Serialize for RewrittenServerError
impl StructuralPartialEq for RewrittenServerError
Auto Trait Implementations§
impl Freeze for RewrittenServerError
impl RefUnwindSafe for RewrittenServerError
impl Send for RewrittenServerError
impl Sync for RewrittenServerError
impl Unpin for RewrittenServerError
impl UnsafeUnpin for RewrittenServerError
impl UnwindSafe for RewrittenServerError
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.