diff options
author | Lukas Wirth <[email protected]> | 2021-03-21 19:08:08 +0000 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-03-23 10:32:10 +0000 |
commit | bad4e48672f928644457cece3b7e21dd78ea1e9b (patch) | |
tree | ae9a17f4f08b05204b78a5d015ff7ece1305e88d /crates/hir | |
parent | 1efd220f2f844596dd22bfd73a8a0c596354be38 (diff) |
Set up a search scope when searching for mbe macro references
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()` |