fix: Fix completions disappearing when typing two keys in quick succession

This commit is contained in:
Lukas Wirth
2022-06-01 00:20:28 +02:00
parent 1234d8647f
commit e2da967578
7 changed files with 83 additions and 74 deletions

View File

@@ -49,7 +49,7 @@ pub use crate::{caps::server_capabilities, main_loop::main_loop};
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> {
pub fn from_json<T: DeserializeOwned>(what: &'static str, json: &serde_json::Value) -> Result<T> {
let res = serde_json::from_value(json.clone())
.map_err(|e| format!("Failed to deserialize {}: {}; {}", what, e, json))?;
Ok(res)