Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide_completion/src/completions/attribute/derive.rs')
-rw-r--r--crates/ide_completion/src/completions/attribute/derive.rs13
1 files changed, 3 insertions, 10 deletions
diff --git a/crates/ide_completion/src/completions/attribute/derive.rs b/crates/ide_completion/src/completions/attribute/derive.rs
index 3cab1918f3..8aaade350f 100644
--- a/crates/ide_completion/src/completions/attribute/derive.rs
+++ b/crates/ide_completion/src/completions/attribute/derive.rs
@@ -13,17 +13,10 @@ use crate::{
item::CompletionItem, Completions, ImportEdit,
};
-pub(super) fn complete_derive(
- acc: &mut Completions,
- ctx: &CompletionContext,
- existing_derives: &[ast::Path],
-) {
+pub(super) fn complete_derive(acc: &mut Completions, ctx: &CompletionContext, attr: &ast::Attr) {
let core = ctx.famous_defs().core();
- let existing_derives: FxHashSet<_> = existing_derives
- .into_iter()
- .filter_map(|path| ctx.scope.speculative_resolve_as_mac(&path))
- .filter(|mac| mac.kind() == MacroKind::Derive)
- .collect();
+ let existing_derives: FxHashSet<_> =
+ ctx.sema.resolve_derive_macro(attr).into_iter().flatten().collect();
for (name, mac) in get_derives_in_scope(ctx) {
if existing_derives.contains(&mac) {