mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
fix: Pass .cargo/config.toml env vars to proc-macro server
This commit is contained in:
parent
2c05da15a9
commit
a981db53fa
6 changed files with 83 additions and 13 deletions
|
@ -468,8 +468,19 @@ impl GlobalState {
|
|||
None => ws.find_sysroot_proc_macro_srv()?,
|
||||
};
|
||||
|
||||
let env = match ws {
|
||||
ProjectWorkspace::Cargo { cargo_config_extra_env, .. } => {
|
||||
cargo_config_extra_env
|
||||
.iter()
|
||||
.chain(self.config.extra_env())
|
||||
.map(|(a, b)| (a.clone(), b.clone()))
|
||||
.collect()
|
||||
}
|
||||
_ => Default::default(),
|
||||
};
|
||||
tracing::info!("Using proc-macro server at {path}");
|
||||
ProcMacroServer::spawn(path.clone()).map_err(|err| {
|
||||
|
||||
ProcMacroServer::spawn(path.clone(), &env).map_err(|err| {
|
||||
tracing::error!(
|
||||
"Failed to run proc-macro server from path {path}, error: {err:?}",
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue