From 177becea98bddcd995a2abec59c6b60bac6b5a2b Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Thu, 16 Apr 2020 21:13:57 +0800 Subject: Add proc-macro cli command for rust-analyzer --- crates/ra_proc_macro_srv/src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'crates/ra_proc_macro_srv/src/lib.rs') diff --git a/crates/ra_proc_macro_srv/src/lib.rs b/crates/ra_proc_macro_srv/src/lib.rs index 59716cbb3..c62b0ed89 100644 --- a/crates/ra_proc_macro_srv/src/lib.rs +++ b/crates/ra_proc_macro_srv/src/lib.rs @@ -22,7 +22,7 @@ mod dylib; use proc_macro::bridge::client::TokenStream; use ra_proc_macro::{ExpansionResult, ExpansionTask, ListMacrosResult, ListMacrosTask}; -pub fn expand_task(task: &ExpansionTask) -> Result { +pub(crate) fn expand_task(task: &ExpansionTask) -> Result { let expander = dylib::Expander::new(&task.lib) .expect(&format!("Cannot expand with provided libraries: ${:?}", &task.lib)); @@ -39,7 +39,7 @@ pub fn expand_task(task: &ExpansionTask) -> Result { } } -pub fn list_macros(task: &ListMacrosTask) -> Result { +pub(crate) fn list_macros(task: &ListMacrosTask) -> Result { let expander = dylib::Expander::new(&task.lib) .expect(&format!("Cannot expand with provided libraries: ${:?}", &task.lib)); @@ -53,5 +53,7 @@ pub fn list_macros(task: &ListMacrosTask) -> Result { } } +pub mod cli; + #[cfg(test)] mod tests; -- cgit v1.2.3