diff options
author | Jonas Schievink <[email protected]> | 2021-06-08 16:31:47 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-06-08 16:31:47 +0100 |
commit | ee374ff1ee7ad1af6bc0624f98b2028cef6ed4a8 (patch) | |
tree | 8adfe5094cbeca97cecdb78d24857441a10003e6 /crates/hir | |
parent | 16e142cd395f264ba5c6c3814ece92431415c089 (diff) |
fix: don't complete derive macros as fn-like macros
Diffstat (limited to 'crates/hir')
-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()` |