9040: Don't label derive macros with their banged_name r=Veykril a=Veykril

cc https://github.com/rust-analyzer/rust-analyzer/issues/7072#issuecomment-850396203
This doesn't fix it non builtin derives yet I think cause of a FIXME somewhere that doesn't categorize proc-macro derives as derives yet
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
bors[bot] 2021-05-28 12:59:54 +00:00 committed by GitHub
commit 2968731fd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,7 +74,11 @@ impl<'a> MacroRender<'a> {
if self.needs_bang() && self.ctx.snippet_cap().is_some() {
format!("{}!{}{}", self.name, self.bra, self.ket)
} else {
self.banged_name()
if self.macro_.kind() == hir::MacroKind::Derive {
self.name.to_string()
} else {
self.banged_name()
}
}
}