mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-27 22:04:17 +00:00
Remove proc macro management thread
This commit is contained in:
parent
552b50de9e
commit
5a9ca311e3
3 changed files with 44 additions and 71 deletions
|
@ -20,7 +20,7 @@ use std::{
|
|||
|
||||
use tt::{SmolStr, Subtree};
|
||||
|
||||
use crate::process::{ProcMacroProcessSrv, ProcMacroProcessThread};
|
||||
use crate::process::ProcMacroProcessSrv;
|
||||
|
||||
pub use rpc::{ExpansionResult, ExpansionTask, ListMacrosResult, ListMacrosTask, ProcMacroKind};
|
||||
pub use version::{read_dylib_info, RustCInfo};
|
||||
|
@ -64,16 +64,16 @@ impl base_db::ProcMacroExpander for ProcMacroProcessExpander {
|
|||
#[derive(Debug)]
|
||||
pub struct ProcMacroClient {
|
||||
process: Arc<ProcMacroProcessSrv>,
|
||||
thread: ProcMacroProcessThread,
|
||||
}
|
||||
|
||||
impl ProcMacroClient {
|
||||
/// Spawns an external process as the proc macro server and returns a client connected to it.
|
||||
pub fn extern_process(
|
||||
process_path: PathBuf,
|
||||
args: impl IntoIterator<Item = impl AsRef<OsStr>>,
|
||||
) -> io::Result<ProcMacroClient> {
|
||||
let (thread, process) = ProcMacroProcessSrv::run(process_path, args)?;
|
||||
Ok(ProcMacroClient { process: Arc::new(process), thread })
|
||||
let process = ProcMacroProcessSrv::run(process_path, args)?;
|
||||
Ok(ProcMacroClient { process: Arc::new(process) })
|
||||
}
|
||||
|
||||
pub fn by_dylib_path(&self, dylib_path: &Path) -> Vec<ProcMacro> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue