Skip to content

Commit d59bf33

Browse files
bors[bot]matklad
andauthored
Merge #2349
2349: Ban println in lsp_server r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
2 parents d25ae6b + 6fbad06 commit d59bf33

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

crates/ra_lsp_server/src/lib.rs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
1-
//! FIXME: write short doc here
2-
1+
//! Implementation of the LSP for rust-analyzer.
2+
//!
3+
//! This crate takes Rust-specific analysis results from ra_ide_api 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.
38
#![recursion_limit = "512"]
9+
10+
#[allow(unused)]
11+
macro_rules! println {
12+
($($tt:tt)*) => {
13+
compile_error!("stdout is locked, use eprintln")
14+
};
15+
}
16+
17+
#[allow(unused)]
18+
macro_rules! print {
19+
($($tt:tt)*) => {
20+
compile_error!("stdout is locked, use eprint")
21+
};
22+
}
23+
424
mod caps;
525
mod cargo_target_spec;
626
mod conv;

crates/ra_lsp_server/src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
//! FIXME: write short doc here
1+
//! `ra_lsp_server` binary
22
33
use flexi_logger::{Duplicate, Logger};
44
use lsp_server::Connection;
5-
65
use ra_lsp_server::{show_message, Result, ServerConfig};
76
use ra_prof;
87

0 commit comments

Comments
 (0)