diff options
Diffstat (limited to 'crates/hir')
-rw-r--r-- | crates/hir/src/lib.rs | 5 |
1 files changed, 5 insertions, 0 deletions
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 { | |||
1150 | // FIXME: wrong for `ProcMacro` | 1150 | // FIXME: wrong for `ProcMacro` |
1151 | matches!(self.id.kind, MacroDefKind::ProcMacro(..) | MacroDefKind::BuiltInDerive(..)) | 1151 | matches!(self.id.kind, MacroDefKind::ProcMacro(..) | MacroDefKind::BuiltInDerive(..)) |
1152 | } | 1152 | } |
1153 | |||
1154 | /// Indicate it is a declarative macro | ||
1155 | pub fn is_declarative(&self) -> bool { | ||
1156 | matches!(self.id.kind, MacroDefKind::Declarative(..)) | ||
1157 | } | ||
1153 | } | 1158 | } |
1154 | 1159 | ||
1155 | /// Invariant: `inner.as_assoc_item(db).is_some()` | 1160 | /// Invariant: `inner.as_assoc_item(db).is_some()` |