mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-14 09:36:06 +00:00
Merge #9059
9059: fix: Only complete derive proc macros in `#[derive]` r=jonas-schievink a=jonas-schievink HIR now gives them `MacroKind::Derive` instead of `MacroKind::ProcMacro` bors r+ Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
This commit is contained in:
commit
06b301e2f8
@ -50,8 +50,7 @@ fn get_derive_names_in_scope(ctx: &CompletionContext) -> FxHashSet<String> {
|
||||
let mut result = FxHashSet::default();
|
||||
ctx.scope.process_all_names(&mut |name, scope_def| {
|
||||
if let hir::ScopeDef::MacroDef(mac) = scope_def {
|
||||
// FIXME kind() doesn't check whether proc-macro is a derive
|
||||
if mac.kind() == hir::MacroKind::Derive || mac.kind() == hir::MacroKind::ProcMacro {
|
||||
if mac.kind() == hir::MacroKind::Derive {
|
||||
result.insert(name.to_string());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user