diff options
Diffstat (limited to 'crates/ra_proc_macro_srv/src/cli.rs')
-rw-r--r-- | crates/ra_proc_macro_srv/src/cli.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/ra_proc_macro_srv/src/cli.rs b/crates/ra_proc_macro_srv/src/cli.rs index 7282e5b9b..1437794c9 100644 --- a/crates/ra_proc_macro_srv/src/cli.rs +++ b/crates/ra_proc_macro_srv/src/cli.rs | |||
@@ -1,15 +1,17 @@ | |||
1 | //! Driver for proc macro server | 1 | //! Driver for proc macro server |
2 | 2 | ||
3 | use crate::{expand_task, list_macros}; | 3 | use crate::ProcMacroSrv; |
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() -> io::Result<()> { | 7 | pub fn run() -> io::Result<()> { |
8 | let mut srv = ProcMacroSrv::default(); | ||
9 | |||
8 | while let Some(req) = read_request()? { | 10 | while let Some(req) = read_request()? { |
9 | let res = match req { | 11 | let res = match req { |
10 | msg::Request::ListMacro(task) => Ok(msg::Response::ListMacro(list_macros(&task))), | 12 | msg::Request::ListMacro(task) => srv.list_macros(&task).map(msg::Response::ListMacro), |
11 | msg::Request::ExpansionMacro(task) => { | 13 | msg::Request::ExpansionMacro(task) => { |
12 | expand_task(&task).map(msg::Response::ExpansionMacro) | 14 | srv.expand(&task).map(msg::Response::ExpansionMacro) |
13 | } | 15 | } |
14 | }; | 16 | }; |
15 | 17 | ||