mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Fix extern_process args
This commit is contained in:
parent
177becea98
commit
b4c5ee33ae
2 changed files with 22 additions and 8 deletions
|
@ -12,6 +12,7 @@ pub mod msg;
|
|||
use process::{ProcMacroProcessSrv, ProcMacroProcessThread};
|
||||
use ra_tt::{SmolStr, Subtree};
|
||||
use std::{
|
||||
ffi::OsStr,
|
||||
path::{Path, PathBuf},
|
||||
sync::Arc,
|
||||
};
|
||||
|
@ -56,10 +57,14 @@ pub struct ProcMacroClient {
|
|||
}
|
||||
|
||||
impl ProcMacroClient {
|
||||
pub fn extern_process<T: AsRef<str>>(
|
||||
pub fn extern_process<I, S>(
|
||||
process_path: &Path,
|
||||
args: &[T],
|
||||
) -> Result<ProcMacroClient, std::io::Error> {
|
||||
args: I,
|
||||
) -> Result<ProcMacroClient, std::io::Error>
|
||||
where
|
||||
I: IntoIterator<Item = S>,
|
||||
S: AsRef<OsStr>,
|
||||
{
|
||||
let (thread, process) = ProcMacroProcessSrv::run(process_path, args)?;
|
||||
Ok(ProcMacroClient {
|
||||
kind: ProcMacroClientKind::Process { process: Arc::new(process), thread },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue