mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-21 15:51:46 +00:00
Use interior mutability for loaded ProcMacrorv::expanders
This commit is contained in:
parent
0e0dbd1497
commit
5ec0057418
3 changed files with 29 additions and 22 deletions
|
@ -21,18 +21,16 @@ pub(crate) fn run() -> io::Result<()> {
|
|||
}
|
||||
}
|
||||
|
||||
let read_request =
|
||||
|buf: &mut String| msg::Request::read(read_json, &mut io::stdin().lock(), buf);
|
||||
|
||||
let mut buf = String::new();
|
||||
let mut read_request = || msg::Request::read(read_json, &mut io::stdin().lock(), &mut buf);
|
||||
let write_response = |msg: msg::Response| msg.write(write_json, &mut io::stdout().lock());
|
||||
|
||||
let env = EnvSnapshot::default();
|
||||
let mut srv = proc_macro_srv::ProcMacroSrv::new(&env);
|
||||
let mut buf = String::new();
|
||||
let srv = proc_macro_srv::ProcMacroSrv::new(&env);
|
||||
|
||||
let mut span_mode = SpanMode::Id;
|
||||
|
||||
while let Some(req) = read_request(&mut buf)? {
|
||||
while let Some(req) = read_request()? {
|
||||
let res = match req {
|
||||
msg::Request::ListMacros { dylib_path } => {
|
||||
msg::Response::ListMacros(srv.list_macros(&dylib_path).map(|macros| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue