mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 11:20:54 +00:00
Only complete derive proc macros in #[derive]
This commit is contained in:
parent
505329b9bb
commit
39533ad7dd
@ -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());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user