Add proc-macro cli command for rust-analyzer

This commit is contained in:
Edwin Cheng 2020-04-16 21:13:57 +08:00
parent ca7dc69a8e
commit 177becea98
14 changed files with 47 additions and 26 deletions

View file

@ -56,8 +56,11 @@ pub struct ProcMacroClient {
}
impl ProcMacroClient {
pub fn extern_process(process_path: &Path) -> Result<ProcMacroClient, std::io::Error> {
let (thread, process) = ProcMacroProcessSrv::run(process_path)?;
pub fn extern_process<T: AsRef<str>>(
process_path: &Path,
args: &[T],
) -> Result<ProcMacroClient, std::io::Error> {
let (thread, process) = ProcMacroProcessSrv::run(process_path, args)?;
Ok(ProcMacroClient {
kind: ProcMacroClientKind::Process { process: Arc::new(process), thread },
})