Only complete derive proc macros in #[derive]

This commit is contained in:
Jonas Schievink 2021-05-29 21:18:14 +02:00
parent 505329b9bb
commit 39533ad7dd

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