Skip to content

Commit 06b301e

Browse files
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>
2 parents 505329b + 39533ad commit 06b301e

File tree

1 file changed

+1
-2
lines changed
  • crates/ide_completion/src/completions/attribute

1 file changed

+1
-2
lines changed

crates/ide_completion/src/completions/attribute/derive.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ fn get_derive_names_in_scope(ctx: &CompletionContext) -> FxHashSet<String> {
5050
let mut result = FxHashSet::default();
5151
ctx.scope.process_all_names(&mut |name, scope_def| {
5252
if let hir::ScopeDef::MacroDef(mac) = scope_def {
53-
// FIXME kind() doesn't check whether proc-macro is a derive
54-
if mac.kind() == hir::MacroKind::Derive || mac.kind() == hir::MacroKind::ProcMacro {
53+
if mac.kind() == hir::MacroKind::Derive {
5554
result.insert(name.to_string());
5655
}
5756
}

0 commit comments

Comments
 (0)