From 4e89c2a66470b5728425a9031b095ae96ddb2b34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Wed, 23 Dec 2020 13:21:58 +0200 Subject: Try serde_path_to_error for LSP InitializeParams --- crates/rust-analyzer/Cargo.toml | 1 + crates/rust-analyzer/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'crates') diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml index 0b4d3f4eb..53e70eaf7 100644 --- a/crates/rust-analyzer/Cargo.toml +++ b/crates/rust-analyzer/Cargo.toml @@ -28,6 +28,7 @@ oorandom = "11.1.2" rustc-hash = "1.1.0" serde = { version = "1.0.106", features = ["derive"] } serde_json = { version = "1.0.48", features = ["preserve_order"] } +serde_path_to_error = "0.1" threadpool = "1.7.1" rayon = "1.5" mimalloc = { version = "0.1.19", default-features = false, optional = true } diff --git a/crates/rust-analyzer/src/lib.rs b/crates/rust-analyzer/src/lib.rs index 79fe30e53..d538ad69a 100644 --- a/crates/rust-analyzer/src/lib.rs +++ b/crates/rust-analyzer/src/lib.rs @@ -46,7 +46,7 @@ pub type Error = Box; pub type Result = std::result::Result; pub fn from_json(what: &'static str, json: serde_json::Value) -> Result { - let res = T::deserialize(&json) + let res = serde_path_to_error::deserialize(&json) .map_err(|e| format!("Failed to deserialize {}: {}; {}", what, e, json))?; Ok(res) } -- cgit v1.2.3