mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-04 10:50:15 +00:00
Faster env snapshotting in proc-macro-srv
This commit is contained in:
parent
678420e66a
commit
2fb38ceb66
6 changed files with 147 additions and 117 deletions
|
@ -33,12 +33,14 @@ fn run() -> io::Result<()> {
|
|||
#[cfg(any(feature = "sysroot-abi", rust_analyzer))]
|
||||
fn run() -> io::Result<()> {
|
||||
use proc_macro_api::msg::{self, Message};
|
||||
use proc_macro_srv::EnvSnapshot;
|
||||
|
||||
let read_request = |buf: &mut String| msg::Request::read(&mut io::stdin().lock(), buf);
|
||||
|
||||
let write_response = |msg: msg::Response| msg.write(&mut io::stdout().lock());
|
||||
|
||||
let mut srv = proc_macro_srv::ProcMacroSrv::default();
|
||||
let env = EnvSnapshot::new();
|
||||
let mut srv = proc_macro_srv::ProcMacroSrv::new(&env);
|
||||
let mut buf = String::new();
|
||||
|
||||
while let Some(req) = read_request(&mut buf)? {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue