Skip to content

Commit 4e89c2a

Browse files
committed
Try serde_path_to_error for LSP InitializeParams
1 parent 85a2875 commit 4e89c2a

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

Cargo.lock

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/rust-analyzer/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ oorandom = "11.1.2"
2828
rustc-hash = "1.1.0"
2929
serde = { version = "1.0.106", features = ["derive"] }
3030
serde_json = { version = "1.0.48", features = ["preserve_order"] }
31+
serde_path_to_error = "0.1"
3132
threadpool = "1.7.1"
3233
rayon = "1.5"
3334
mimalloc = { version = "0.1.19", default-features = false, optional = true }

crates/rust-analyzer/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub type Error = Box<dyn std::error::Error + Send + Sync>;
4646
pub type Result<T, E = Error> = std::result::Result<T, E>;
4747

4848
pub fn from_json<T: DeserializeOwned>(what: &'static str, json: serde_json::Value) -> Result<T> {
49-
let res = T::deserialize(&json)
49+
let res = serde_path_to_error::deserialize(&json)
5050
.map_err(|e| format!("Failed to deserialize {}: {}; {}", what, e, json))?;
5151
Ok(res)
5252
}

0 commit comments

Comments
 (0)