diff options
Diffstat (limited to 'crates/hir/src')
-rw-r--r-- | crates/hir/src/lib.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index c2b68a853..b5209546c 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs | |||
@@ -1351,6 +1351,13 @@ impl MacroDef { | |||
1351 | MacroDefKind::ProcMacro(_, base_db::ProcMacroKind::FuncLike, _) => MacroKind::ProcMacro, | 1351 | MacroDefKind::ProcMacro(_, base_db::ProcMacroKind::FuncLike, _) => MacroKind::ProcMacro, |
1352 | } | 1352 | } |
1353 | } | 1353 | } |
1354 | |||
1355 | pub fn is_fn_like(&self) -> bool { | ||
1356 | match self.kind() { | ||
1357 | MacroKind::Declarative | MacroKind::BuiltIn | MacroKind::ProcMacro => true, | ||
1358 | MacroKind::Attr | MacroKind::Derive => false, | ||
1359 | } | ||
1360 | } | ||
1354 | } | 1361 | } |
1355 | 1362 | ||
1356 | /// Invariant: `inner.as_assoc_item(db).is_some()` | 1363 | /// Invariant: `inner.as_assoc_item(db).is_some()` |