mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-25 04:44:22 +00:00
internal: a bit more of cwd safety for flycheck
This commit is contained in:
parent
8df38aa797
commit
8d8c26e6f5
16 changed files with 72 additions and 52 deletions
|
@ -30,7 +30,7 @@ pub(crate) struct ProcMacroSrv {
|
|||
|
||||
impl ProcMacroSrv {
|
||||
pub fn expand(&mut self, task: &ExpansionTask) -> Result<ExpansionResult, String> {
|
||||
let expander = self.expander(&task.lib)?;
|
||||
let expander = self.expander(task.lib.as_ref())?;
|
||||
|
||||
let mut prev_env = HashMap::new();
|
||||
for (k, v) in &task.env {
|
||||
|
@ -54,7 +54,7 @@ impl ProcMacroSrv {
|
|||
}
|
||||
|
||||
pub fn list_macros(&mut self, task: &ListMacrosTask) -> Result<ListMacrosResult, String> {
|
||||
let expander = self.expander(&task.lib)?;
|
||||
let expander = self.expander(task.lib.as_ref())?;
|
||||
Ok(ListMacrosResult { macros: expander.list_macros() })
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue