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.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/ide_completion/src/completions.rs b/crates/ide_completion/src/completions.rs
index 380cfe95dd..91e6b84294 100644
--- a/crates/ide_completion/src/completions.rs
+++ b/crates/ide_completion/src/completions.rs
@@ -35,6 +35,7 @@ use crate::{
render_field, render_resolution, render_tuple_field,
struct_literal::render_struct_literal,
type_alias::{render_type_alias, render_type_alias_with_eq},
+ union_literal::render_union_literal,
RenderContext,
},
CompletionContext, CompletionItem, CompletionItemKind,
@@ -234,6 +235,17 @@ impl Completions {
self.add_opt(item);
}
+ pub(crate) fn add_union_literal(
+ &mut self,
+ ctx: &CompletionContext,
+ un: hir::Union,
+ path: Option<hir::ModPath>,
+ local_name: Option<hir::Name>,
+ ) {
+ let item = render_union_literal(RenderContext::new(ctx, false), un, path, local_name);
+ self.add_opt(item);
+ }
+
pub(crate) fn add_tuple_field(
&mut self,
ctx: &CompletionContext,