@@ -126,7 +126,7 @@ impl Completions {
126126 cov_mark:: hit!( qualified_path_doc_hidden) ;
127127 return ;
128128 }
129- self . add ( render_resolution ( RenderContext :: new ( ctx) , local_name, resolution) ) ;
129+ self . add ( render_resolution ( RenderContext :: new ( ctx) , local_name, resolution) . build ( ) ) ;
130130 }
131131
132132 pub ( crate ) fn add_resolution_simple (
@@ -138,7 +138,7 @@ impl Completions {
138138 if ctx. is_scope_def_hidden ( resolution) {
139139 return ;
140140 }
141- self . add ( render_resolution_simple ( RenderContext :: new ( ctx) , local_name, resolution) ) ;
141+ self . add ( render_resolution_simple ( RenderContext :: new ( ctx) , local_name, resolution) . build ( ) ) ;
142142 }
143143
144144 pub ( crate ) fn add_macro (
@@ -152,11 +152,14 @@ impl Completions {
152152 Visible :: Editable => true ,
153153 Visible :: No => return ,
154154 } ;
155- self . add ( render_macro (
156- RenderContext :: new ( ctx) . private_editable ( is_private_editable) ,
157- local_name,
158- mac,
159- ) ) ;
155+ self . add (
156+ render_macro (
157+ RenderContext :: new ( ctx) . private_editable ( is_private_editable) ,
158+ local_name,
159+ mac,
160+ )
161+ . build ( ) ,
162+ ) ;
160163 }
161164
162165 pub ( crate ) fn add_function (
@@ -170,11 +173,14 @@ impl Completions {
170173 Visible :: Editable => true ,
171174 Visible :: No => return ,
172175 } ;
173- self . add ( render_fn (
174- RenderContext :: new ( ctx) . private_editable ( is_private_editable) ,
175- local_name,
176- func,
177- ) ) ;
176+ self . add (
177+ render_fn (
178+ RenderContext :: new ( ctx) . private_editable ( is_private_editable) ,
179+ local_name,
180+ func,
181+ )
182+ . build ( ) ,
183+ ) ;
178184 }
179185
180186 pub ( crate ) fn add_method (
@@ -189,12 +195,15 @@ impl Completions {
189195 Visible :: Editable => true ,
190196 Visible :: No => return ,
191197 } ;
192- self . add ( render_method (
193- RenderContext :: new ( ctx) . private_editable ( is_private_editable) ,
194- receiver,
195- local_name,
196- func,
197- ) ) ;
198+ self . add (
199+ render_method (
200+ RenderContext :: new ( ctx) . private_editable ( is_private_editable) ,
201+ receiver,
202+ local_name,
203+ func,
204+ )
205+ . build ( ) ,
206+ ) ;
198207 }
199208
200209 pub ( crate ) fn add_const ( & mut self , ctx : & CompletionContext , konst : hir:: Const ) {
@@ -235,7 +244,11 @@ impl Completions {
235244 variant : hir:: Variant ,
236245 path : hir:: ModPath ,
237246 ) {
238- self . add_opt ( render_variant_lit ( RenderContext :: new ( ctx) , None , variant, Some ( path) ) ) ;
247+ if let Some ( builder) =
248+ render_variant_lit ( RenderContext :: new ( ctx) , None , variant, Some ( path) )
249+ {
250+ self . add ( builder. build ( ) ) ;
251+ }
239252 }
240253
241254 pub ( crate ) fn add_enum_variant (
@@ -244,7 +257,11 @@ impl Completions {
244257 variant : hir:: Variant ,
245258 local_name : Option < hir:: Name > ,
246259 ) {
247- self . add_opt ( render_variant_lit ( RenderContext :: new ( ctx) , local_name, variant, None ) ) ;
260+ if let Some ( builder) =
261+ render_variant_lit ( RenderContext :: new ( ctx) , local_name, variant, None )
262+ {
263+ self . add ( builder. build ( ) ) ;
264+ }
248265 }
249266
250267 pub ( crate ) fn add_field (
@@ -275,8 +292,11 @@ impl Completions {
275292 path : Option < hir:: ModPath > ,
276293 local_name : Option < hir:: Name > ,
277294 ) {
278- let item = render_struct_literal ( RenderContext :: new ( ctx) , strukt, path, local_name) ;
279- self . add_opt ( item) ;
295+ if let Some ( builder) =
296+ render_struct_literal ( RenderContext :: new ( ctx) , strukt, path, local_name)
297+ {
298+ self . add ( builder. build ( ) ) ;
299+ }
280300 }
281301
282302 pub ( crate ) fn add_union_literal (
0 commit comments