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