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:
bors[bot] 2021-05-29 19:19:24 +00:00 committed by GitHub
commit 06b301e2f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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());
}
}