]> git.lizzy.rs Git - rust.git/blobdiff - crates/rust-analyzer/src/lib.rs
internal: prepare to track changes to mem_docs
[rust.git] / crates / rust-analyzer / src / lib.rs
index a24dfe58c63bcc6bd128fc60affc73f333a54047..a5997d69d9ae88b3c674df8cca990b329baeb059 100644 (file)
@@ -1,6 +1,6 @@
 //! Implementation of the LSP for rust-analyzer.
 //!
-//! This crate takes Rust-specific analysis results from ra_ide and translates
+//! This crate takes Rust-specific analysis results from ide and translates
 //! into LSP types.
 //!
 //! It also is the root of all state. `world` module defines the bulk of the
@@ -29,21 +29,29 @@ macro_rules! eprintln {
 mod semantic_tokens;
 mod markdown;
 mod diagnostics;
-mod line_endings;
+mod line_index;
 mod request_metrics;
 mod lsp_utils;
 mod thread_pool;
+mod mem_docs;
+mod diff;
+mod op_queue;
 pub mod lsp_ext;
 pub mod config;
 
-use serde::de::DeserializeOwned;
+#[cfg(test)]
+mod integrated_benchmarks;
 
-pub type Result<T, E = Box<dyn std::error::Error + Send + Sync>> = std::result::Result<T, E>;
-pub use crate::{caps::server_capabilities, lsp_utils::show_message, main_loop::main_loop};
+use serde::de::DeserializeOwned;
 use std::fmt;
 
+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> {
-    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)
 }