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