fix: don't complete derive macros as fn-like macros

This commit is contained in:
Jonas Schievink 2021-06-08 17:31:47 +02:00
parent 16e142cd39
commit ee374ff1ee
4 changed files with 88 additions and 4 deletions

View file

@ -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()`