From ee374ff1ee7ad1af6bc0624f98b2028cef6ed4a8 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Tue, 8 Jun 2021 17:31:47 +0200 Subject: fix: don't complete derive macros as fn-like macros --- crates/hir/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crates/hir') 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 { MacroDefKind::ProcMacro(_, base_db::ProcMacroKind::FuncLike, _) => MacroKind::ProcMacro, } } + + pub fn is_fn_like(&self) -> bool { + match self.kind() { + MacroKind::Declarative | MacroKind::BuiltIn | MacroKind::ProcMacro => true, + MacroKind::Attr | MacroKind::Derive => false, + } + } } /// Invariant: `inner.as_assoc_item(db).is_some()` -- cgit v1.2.3