Don't recreate Hygiene unnecessarily

This commit is contained in:
Lukas Wirth 2023-04-06 21:16:11 +02:00
parent b7c443569a
commit f742943a4b
9 changed files with 35 additions and 51 deletions

View file

@ -463,7 +463,7 @@ impl SourceAnalyzer {
db: &dyn HirDatabase,
macro_call: InFile<&ast::MacroCall>,
) -> Option<Macro> {
let ctx = body::LowerCtx::new(db.upcast(), macro_call.file_id);
let ctx = body::LowerCtx::with_file_id(db.upcast(), macro_call.file_id);
let path = macro_call.value.path().and_then(|ast| Path::from_src(ast, &ctx))?;
self.resolver.resolve_path_as_macro(db.upcast(), path.mod_path()?).map(|it| it.into())
}