Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/completions/attribute.rs')
-rw-r--r--crates/ide-completion/src/completions/attribute.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/crates/ide-completion/src/completions/attribute.rs b/crates/ide-completion/src/completions/attribute.rs
index d0b489c4e8..cf5427bae3 100644
--- a/crates/ide-completion/src/completions/attribute.rs
+++ b/crates/ide-completion/src/completions/attribute.rs
@@ -86,10 +86,21 @@ pub(crate) fn complete_attribute_path(
acc: &mut Completions,
ctx: &CompletionContext<'_>,
path_ctx @ PathCompletionCtx { qualified, .. }: &PathCompletionCtx,
- &AttrCtx { kind, annotated_item_kind }: &AttrCtx,
+ &AttrCtx { kind, annotated_item_kind, ref derive_helpers }: &AttrCtx,
) {
let is_inner = kind == AttrKind::Inner;
+ for (derive_helper, derive_name) in derive_helpers {
+ let mut item = CompletionItem::new(
+ SymbolKind::Attribute,
+ ctx.source_range(),
+ derive_helper.as_str(),
+ ctx.edition,
+ );
+ item.detail(format!("derive helper of `{derive_name}`"));
+ item.add_to(acc, ctx.db);
+ }
+
match qualified {
Qualified::With {
resolution: Some(hir::PathResolution::Def(hir::ModuleDef::Module(module))),