mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +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();
|
let mut result = FxHashSet::default();
|
||||||
ctx.scope.process_all_names(&mut |name, scope_def| {
|
ctx.scope.process_all_names(&mut |name, scope_def| {
|
||||||
if let hir::ScopeDef::MacroDef(mac) = 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 {
|
||||||
if mac.kind() == hir::MacroKind::Derive || mac.kind() == hir::MacroKind::ProcMacro {
|
|
||||||
result.insert(name.to_string());
|
result.insert(name.to_string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user