mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
ra_proc_macro: cleanups here and there
This commit is contained in:
parent
36840bd6c7
commit
d3019164dc
12 changed files with 141 additions and 190 deletions
|
@ -51,7 +51,7 @@ fn main() -> Result<()> {
|
|||
cli::diagnostics(path.as_ref(), load_output_dirs, with_proc_macro, all)?
|
||||
}
|
||||
|
||||
args::Command::ProcMacro => run_proc_macro_sv()?,
|
||||
args::Command::ProcMacro => run_proc_macro_srv()?,
|
||||
args::Command::RunServer => run_server()?,
|
||||
args::Command::Version => println!("rust-analyzer {}", env!("REV")),
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ fn setup_logging() -> Result<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn run_proc_macro_sv() -> Result<()> {
|
||||
fn run_proc_macro_srv() -> Result<()> {
|
||||
ra_proc_macro_srv::cli::run();
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ pub(crate) fn load_cargo(
|
|||
ProcMacroClient::dummy()
|
||||
} else {
|
||||
let path = std::env::current_exe()?;
|
||||
ProcMacroClient::extern_process(&path, &["proc-macro"]).unwrap()
|
||||
ProcMacroClient::extern_process(path, &["proc-macro"]).unwrap()
|
||||
};
|
||||
let host = load(&source_roots, ws, &mut vfs, receiver, extern_dirs, &proc_macro_client);
|
||||
Ok((host, source_roots))
|
||||
|
|
|
@ -148,20 +148,17 @@ impl WorldState {
|
|||
|
||||
let proc_macro_client = match &config.proc_macro_srv {
|
||||
None => ProcMacroClient::dummy(),
|
||||
Some((path, args)) => {
|
||||
let path = std::path::Path::new(path);
|
||||
match ProcMacroClient::extern_process(path, args) {
|
||||
Ok(it) => it,
|
||||
Err(err) => {
|
||||
log::error!(
|
||||
"Fail to run ra_proc_macro_srv from path {}, error : {}",
|
||||
path.to_string_lossy(),
|
||||
err
|
||||
);
|
||||
ProcMacroClient::dummy()
|
||||
}
|
||||
Some((path, args)) => match ProcMacroClient::extern_process(path.into(), args) {
|
||||
Ok(it) => it,
|
||||
Err(err) => {
|
||||
log::error!(
|
||||
"Fail to run ra_proc_macro_srv from path {}, error: {:?}",
|
||||
path,
|
||||
err
|
||||
);
|
||||
ProcMacroClient::dummy()
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
workspaces
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue