aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-05-29 20:19:24 +0100
committerGitHub <[email protected]>2021-05-29 20:19:24 +0100
commit06b301e2f8a9f8607dfe3f0132dce68deae74ad5 (patch)
treec1b23a7cc1061ae10a302784a2e8f6b7930b38e3 /crates
parent505329b9bb66484276f2b04ee2aa2c59ccce72d6 (diff)
parent39533ad7dd30d6dd3725f69555666c212c454a12 (diff)
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 <[email protected]>
Diffstat (limited to 'crates')
-rw-r--r--crates/ide_completion/src/completions/attribute/derive.rs3
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 }