Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/completions.rs')
-rw-r--r--crates/ide-completion/src/completions.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/ide-completion/src/completions.rs b/crates/ide-completion/src/completions.rs
index b537150608..414627fbab 100644
--- a/crates/ide-completion/src/completions.rs
+++ b/crates/ide-completion/src/completions.rs
@@ -617,6 +617,16 @@ impl Completions {
}
self.add_opt(render_struct_pat(RenderContext::new(ctx), pattern_ctx, strukt, local_name));
}
+
+ pub(crate) fn suggest_name(&mut self, ctx: &CompletionContext<'_>, name: &str) {
+ let item = CompletionItem::new(
+ CompletionItemKind::Binding,
+ ctx.source_range(),
+ SmolStr::from(name),
+ ctx.edition,
+ );
+ item.add_to(self, ctx.db);
+ }
}
/// Calls the callback for each variant of the provided enum with the path to the variant.