aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_lsp_server/src/lib.rs')
-rw-r--r--crates/ra_lsp_server/src/lib.rs51
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
10pub mod cli;
11
12#[allow(unused)]
13macro_rules! println {
14 ($($tt:tt)*) => {
15 compile_error!("stdout is locked, use eprintln")
16 };
17}
18
19#[allow(unused)]
20macro_rules! print {
21 ($($tt:tt)*) => {
22 compile_error!("stdout is locked, use eprint")
23 };
24}
25
26mod vfs_glob;
27mod caps;
28mod cargo_target_spec;
29mod conv;
30mod main_loop;
31mod markdown;
32pub mod req;
33mod config;
34mod world;
35mod diagnostics;
36
37use serde::de::DeserializeOwned;
38
39pub type Result<T> = std::result::Result<T, Box<dyn std::error::Error + Send + Sync>>;
40pub use crate::{
41 caps::server_capabilities,
42 config::ServerConfig,
43 main_loop::LspError,
44 main_loop::{main_loop, show_message},
45};
46
47pub 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}