mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +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
|
@ -329,6 +329,10 @@ impl<'db, DB: HirDatabase> Semantics<'db, DB> {
|
|||
self.imp.resolve_path(path)
|
||||
}
|
||||
|
||||
pub fn resolve_path_as_macro(&self, path: &ast::Path) -> Option<MacroDef> {
|
||||
self.imp.resolve_path_as_macro(path)
|
||||
}
|
||||
|
||||
pub fn resolve_extern_crate(&self, extern_crate: &ast::ExternCrate) -> Option<Crate> {
|
||||
self.imp.resolve_extern_crate(extern_crate)
|
||||
}
|
||||
|
@ -845,6 +849,12 @@ impl<'db> SemanticsImpl<'db> {
|
|||
self.analyze(path.syntax()).resolve_path(self.db, path)
|
||||
}
|
||||
|
||||
// FIXME: This shouldn't exist, but is currently required to always resolve attribute paths in
|
||||
// the IDE layer due to namespace collisions
|
||||
fn resolve_path_as_macro(&self, path: &ast::Path) -> Option<MacroDef> {
|
||||
self.analyze(path.syntax()).resolve_path_as_macro(self.db, path)
|
||||
}
|
||||
|
||||
fn resolve_extern_crate(&self, extern_crate: &ast::ExternCrate) -> Option<Crate> {
|
||||
let krate = self.scope(extern_crate.syntax()).krate()?;
|
||||
krate.dependencies(self.db).into_iter().find_map(|dep| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue