diff options
Diffstat (limited to 'crates/ra_proc_macro/src/lib.rs')
-rw-r--r-- | crates/ra_proc_macro/src/lib.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/crates/ra_proc_macro/src/lib.rs b/crates/ra_proc_macro/src/lib.rs index 63da9f1b4..b200fd126 100644 --- a/crates/ra_proc_macro/src/lib.rs +++ b/crates/ra_proc_macro/src/lib.rs | |||
@@ -12,6 +12,7 @@ pub mod msg; | |||
12 | use process::{ProcMacroProcessSrv, ProcMacroProcessThread}; | 12 | use process::{ProcMacroProcessSrv, ProcMacroProcessThread}; |
13 | use ra_tt::{SmolStr, Subtree}; | 13 | use ra_tt::{SmolStr, Subtree}; |
14 | use std::{ | 14 | use std::{ |
15 | ffi::OsStr, | ||
15 | path::{Path, PathBuf}, | 16 | path::{Path, PathBuf}, |
16 | sync::Arc, | 17 | sync::Arc, |
17 | }; | 18 | }; |
@@ -56,8 +57,15 @@ pub struct ProcMacroClient { | |||
56 | } | 57 | } |
57 | 58 | ||
58 | impl ProcMacroClient { | 59 | impl ProcMacroClient { |
59 | pub fn extern_process(process_path: &Path) -> Result<ProcMacroClient, std::io::Error> { | 60 | pub fn extern_process<I, S>( |
60 | let (thread, process) = ProcMacroProcessSrv::run(process_path)?; | 61 | process_path: &Path, |
62 | args: I, | ||
63 | ) -> Result<ProcMacroClient, std::io::Error> | ||
64 | where | ||
65 | I: IntoIterator<Item = S>, | ||
66 | S: AsRef<OsStr>, | ||
67 | { | ||
68 | let (thread, process) = ProcMacroProcessSrv::run(process_path, args)?; | ||
61 | Ok(ProcMacroClient { | 69 | Ok(ProcMacroClient { |
62 | kind: ProcMacroClientKind::Process { process: Arc::new(process), thread }, | 70 | kind: ProcMacroClientKind::Process { process: Arc::new(process), thread }, |
63 | }) | 71 | }) |