mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
fix: don't complete derive macros as fn-like macros
This commit is contained in:
parent
16e142cd39
commit
ee374ff1ee
4 changed files with 88 additions and 4 deletions
|
@ -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()`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue