diff options
Diffstat (limited to 'crates/ra_proc_macro_srv')
-rw-r--r-- | crates/ra_proc_macro_srv/src/cli.rs | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/crates/ra_proc_macro_srv/src/cli.rs b/crates/ra_proc_macro_srv/src/cli.rs index 5f1f3ba3c..7282e5b9b 100644 --- a/crates/ra_proc_macro_srv/src/cli.rs +++ b/crates/ra_proc_macro_srv/src/cli.rs | |||
@@ -4,17 +4,8 @@ use crate::{expand_task, list_macros}; | |||
4 | use ra_proc_macro::msg::{self, Message}; | 4 | use ra_proc_macro::msg::{self, Message}; |
5 | use std::io; | 5 | use std::io; |
6 | 6 | ||
7 | pub fn run() { | 7 | pub fn run() -> io::Result<()> { |
8 | loop { | 8 | while let Some(req) = read_request()? { |
9 | let req = match read_request() { | ||
10 | Err(err) => { | ||
11 | eprintln!("Read message error on ra_proc_macro_srv: {}", err); | ||
12 | continue; | ||
13 | } | ||
14 | Ok(None) => continue, | ||
15 | Ok(Some(req)) => req, | ||
16 | }; | ||
17 | |||
18 | let res = match req { | 9 | let res = match req { |
19 | msg::Request::ListMacro(task) => Ok(msg::Response::ListMacro(list_macros(&task))), | 10 | msg::Request::ListMacro(task) => Ok(msg::Response::ListMacro(list_macros(&task))), |
20 | msg::Request::ExpansionMacro(task) => { | 11 | msg::Request::ExpansionMacro(task) => { |
@@ -33,6 +24,8 @@ pub fn run() { | |||
33 | eprintln!("Write message error: {}", err); | 24 | eprintln!("Write message error: {}", err); |
34 | } | 25 | } |
35 | } | 26 | } |
27 | |||
28 | Ok(()) | ||
36 | } | 29 | } |
37 | 30 | ||
38 | fn read_request() -> io::Result<Option<msg::Request>> { | 31 | fn read_request() -> io::Result<Option<msg::Request>> { |