mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Fix proc-macro attributes being shadowed by their functions in IDE layer
This commit is contained in:
parent
c5c11b87cc
commit
26419c0379
4 changed files with 36 additions and 14 deletions
|
@ -246,6 +246,18 @@ impl SourceAnalyzer {
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) fn resolve_path_as_macro(
|
||||
&self,
|
||||
db: &dyn HirDatabase,
|
||||
path: &ast::Path,
|
||||
) -> Option<MacroDef> {
|
||||
// This must be a normal source file rather than macro file.
|
||||
let hygiene = Hygiene::new(db.upcast(), self.file_id);
|
||||
let ctx = body::LowerCtx::with_hygiene(db.upcast(), &hygiene);
|
||||
let hir_path = Path::from_src(path.clone(), &ctx)?;
|
||||
resolve_hir_path_as_macro(db, &self.resolver, &hir_path)
|
||||
}
|
||||
|
||||
pub(crate) fn resolve_path(
|
||||
&self,
|
||||
db: &dyn HirDatabase,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue