mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Support $crate
in item and expr place.
This commit is contained in:
parent
8cd23a4fb8
commit
2ecb126f5c
14 changed files with 268 additions and 37 deletions
|
@ -203,6 +203,7 @@ impl SourceAnalyzer {
|
|||
db: &impl HirDatabase,
|
||||
macro_call: &ast::MacroCall,
|
||||
) -> Option<MacroDef> {
|
||||
// This must be a normal source file rather than macro file.
|
||||
let path = macro_call.path().and_then(Path::from_ast)?;
|
||||
self.resolver.resolve_path_as_macro(db, &path)
|
||||
}
|
||||
|
@ -261,6 +262,7 @@ impl SourceAnalyzer {
|
|||
return Some(PathResolution::AssocItem(assoc));
|
||||
}
|
||||
}
|
||||
// This must be a normal source file rather than macro file.
|
||||
let hir_path = crate::Path::from_ast(path.clone())?;
|
||||
self.resolve_hir_path(db, &hir_path)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue