Set up a search scope when searching for mbe macro references

This commit is contained in:
Lukas Wirth 2021-03-21 20:08:08 +01:00
parent 1efd220f2f
commit bad4e48672
3 changed files with 56 additions and 4 deletions

View file

@ -1150,6 +1150,11 @@ impl MacroDef {
// FIXME: wrong for `ProcMacro`
matches!(self.id.kind, MacroDefKind::ProcMacro(..) | MacroDefKind::BuiltInDerive(..))
}
/// Indicate it is a declarative macro
pub fn is_declarative(&self) -> bool {
matches!(self.id.kind, MacroDefKind::Declarative(..))
}
}
/// Invariant: `inner.as_assoc_item(db).is_some()`