diff options
author | Jonas Schievink <[email protected]> | 2021-05-29 20:18:14 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-05-29 20:18:14 +0100 |
commit | 39533ad7dd30d6dd3725f69555666c212c454a12 (patch) | |
tree | c1b23a7cc1061ae10a302784a2e8f6b7930b38e3 /crates/ide_completion | |
parent | 505329b9bb66484276f2b04ee2aa2c59ccce72d6 (diff) |
Only complete derive proc macros in `#[derive]`
Diffstat (limited to 'crates/ide_completion')
-rw-r--r-- | crates/ide_completion/src/completions/attribute/derive.rs | 3 |
1 files changed, 1 insertions, 2 deletions
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<String> { | |||
50 | let mut result = FxHashSet::default(); | 50 | let mut result = FxHashSet::default(); |
51 | ctx.scope.process_all_names(&mut |name, scope_def| { | 51 | ctx.scope.process_all_names(&mut |name, scope_def| { |
52 | if let hir::ScopeDef::MacroDef(mac) = scope_def { | 52 | if let hir::ScopeDef::MacroDef(mac) = scope_def { |
53 | // FIXME kind() doesn't check whether proc-macro is a derive | 53 | if mac.kind() == hir::MacroKind::Derive { |
54 | if mac.kind() == hir::MacroKind::Derive || mac.kind() == hir::MacroKind::ProcMacro { | ||
55 | result.insert(name.to_string()); | 54 | result.insert(name.to_string()); |
56 | } | 55 | } |
57 | } | 56 | } |