mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
feat: Make unqualified derive attributes flyimportable
This commit is contained in:
parent
7fdbdc4ab2
commit
ebd63ec1cf
11 changed files with 124 additions and 31 deletions
|
@ -1623,7 +1623,12 @@ impl MacroDef {
|
|||
pub fn name(self, db: &dyn HirDatabase) -> Option<Name> {
|
||||
match self.source(db)?.value {
|
||||
Either::Left(it) => it.name().map(|it| it.as_name()),
|
||||
Either::Right(it) => it.name().map(|it| it.as_name()),
|
||||
Either::Right(_) => {
|
||||
let krate = self.id.krate;
|
||||
let def_map = db.crate_def_map(krate);
|
||||
let (_, name) = def_map.exported_proc_macros().find(|&(id, _)| id == self.id)?;
|
||||
Some(name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue