From bad4e48672f928644457cece3b7e21dd78ea1e9b Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sun, 21 Mar 2021 20:08:08 +0100 Subject: Set up a search scope when searching for mbe macro references --- crates/hir/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'crates/hir') diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 68f4551c0..ea0a60961 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -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()` -- cgit v1.2.3