From 39533ad7dd30d6dd3725f69555666c212c454a12 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Sat, 29 May 2021 21:18:14 +0200 Subject: Only complete derive proc macros in `#[derive]` --- crates/ide_completion/src/completions/attribute/derive.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'crates/ide_completion/src/completions/attribute') diff --git a/crates/ide_completion/src/completions/attribute/derive.rs b/crates/ide_completion/src/completions/attribute/derive.rs index 634c0cb00..0bc3eab98 100644 --- a/crates/ide_completion/src/completions/attribute/derive.rs +++ b/crates/ide_completion/src/completions/attribute/derive.rs @@ -50,8 +50,7 @@ fn get_derive_names_in_scope(ctx: &CompletionContext) -> FxHashSet { 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()); } } -- cgit v1.2.3