diff options
Diffstat (limited to 'crates/ra_lsp_server/src/lib.rs')
-rw-r--r-- | crates/ra_lsp_server/src/lib.rs | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/crates/ra_lsp_server/src/lib.rs b/crates/ra_lsp_server/src/lib.rs deleted file mode 100644 index 958c70fe5..000000000 --- a/crates/ra_lsp_server/src/lib.rs +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | //! Implementation of the LSP for rust-analyzer. | ||
2 | //! | ||
3 | //! This crate takes Rust-specific analysis results from ra_ide and | ||
4 | //! translates into LSP types. | ||
5 | //! | ||
6 | //! It also is the root of all state. `world` module defines the bulk of the | ||
7 | //! state, and `main_loop` module defines the rules for modifying it. | ||
8 | #![recursion_limit = "512"] | ||
9 | |||
10 | pub mod cli; | ||
11 | |||
12 | #[allow(unused)] | ||
13 | macro_rules! println { | ||
14 | ($($tt:tt)*) => { | ||
15 | compile_error!("stdout is locked, use eprintln") | ||
16 | }; | ||
17 | } | ||
18 | |||
19 | #[allow(unused)] | ||
20 | macro_rules! print { | ||
21 | ($($tt:tt)*) => { | ||
22 | compile_error!("stdout is locked, use eprint") | ||
23 | }; | ||
24 | } | ||
25 | |||
26 | mod vfs_glob; | ||
27 | mod caps; | ||
28 | mod cargo_target_spec; | ||
29 | mod conv; | ||
30 | mod main_loop; | ||
31 | mod markdown; | ||
32 | pub mod req; | ||
33 | mod config; | ||
34 | mod world; | ||
35 | mod diagnostics; | ||
36 | |||
37 | use serde::de::DeserializeOwned; | ||
38 | |||
39 | pub type Result<T> = std::result::Result<T, Box<dyn std::error::Error + Send + Sync>>; | ||
40 | pub use crate::{ | ||
41 | caps::server_capabilities, | ||
42 | config::ServerConfig, | ||
43 | main_loop::LspError, | ||
44 | main_loop::{main_loop, show_message}, | ||
45 | }; | ||
46 | |||
47 | pub fn from_json<T: DeserializeOwned>(what: &'static str, json: serde_json::Value) -> Result<T> { | ||
48 | let res = T::deserialize(&json) | ||
49 | .map_err(|e| format!("Failed to deserialize {}: {}; {}", what, e, json))?; | ||
50 | Ok(res) | ||
51 | } | ||