Try serde_path_to_error for LSP InitializeParams
This commit is contained in:
@@ -46,7 +46,7 @@ pub type Error = Box<dyn std::error::Error + Send + Sync>;
|
||||
pub type Result<T, E = Error> = std::result::Result<T, E>;
|
||||
|
||||
pub fn from_json<T: DeserializeOwned>(what: &'static str, json: serde_json::Value) -> Result<T> {
|
||||
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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user