@@ -230,7 +230,7 @@ impl Completions {
230230 resolution : hir:: ScopeDef ,
231231 doc_aliases : Vec < syntax:: SmolStr > ,
232232 ) {
233- let is_private_editable = match ctx. def_is_visible ( & resolution) {
233+ let is_private_editable = match ctx. def_is_visible ( & resolution, & local_name ) {
234234 Visible :: Yes => false ,
235235 Visible :: Editable => true ,
236236 Visible :: No => return ,
@@ -251,7 +251,7 @@ impl Completions {
251251 local_name : hir:: Name ,
252252 resolution : hir:: ScopeDef ,
253253 ) {
254- let is_private_editable = match ctx. def_is_visible ( & resolution) {
254+ let is_private_editable = match ctx. def_is_visible ( & resolution, & local_name ) {
255255 Visible :: Yes => false ,
256256 Visible :: Editable => true ,
257257 Visible :: No => return ,
@@ -300,7 +300,7 @@ impl Completions {
300300 mac : hir:: Macro ,
301301 local_name : hir:: Name ,
302302 ) {
303- let is_private_editable = match ctx. is_visible ( & mac) {
303+ let is_private_editable = match ctx. is_visible ( & mac, & local_name ) {
304304 Visible :: Yes => false ,
305305 Visible :: Editable => true ,
306306 Visible :: No => return ,
@@ -321,7 +321,7 @@ impl Completions {
321321 func : hir:: Function ,
322322 local_name : Option < hir:: Name > ,
323323 ) {
324- let is_private_editable = match ctx. is_visible ( & func) {
324+ let is_private_editable = match ctx. is_visible ( & func, & Name :: missing ( ) ) {
325325 Visible :: Yes => false ,
326326 Visible :: Editable => true ,
327327 Visible :: No => return ,
@@ -342,9 +342,8 @@ impl Completions {
342342 dot_access : & DotAccess < ' _ > ,
343343 func : hir:: Function ,
344344 receiver : Option < SmolStr > ,
345- local_name : Option < hir:: Name > ,
346345 ) {
347- let is_private_editable = match ctx. is_visible ( & func) {
346+ let is_private_editable = match ctx. is_visible ( & func, & Name :: missing ( ) ) {
348347 Visible :: Yes => false ,
349348 Visible :: Editable => true ,
350349 Visible :: No => return ,
@@ -354,7 +353,6 @@ impl Completions {
354353 RenderContext :: new ( ctx) . private_editable ( is_private_editable) . doc_aliases ( doc_aliases) ,
355354 dot_access,
356355 receiver,
357- local_name,
358356 func,
359357 )
360358 . add_to ( self , ctx. db ) ;
@@ -367,7 +365,7 @@ impl Completions {
367365 func : hir:: Function ,
368366 import : LocatedImport ,
369367 ) {
370- let is_private_editable = match ctx. is_visible ( & func) {
368+ let is_private_editable = match ctx. is_visible ( & func, & Name :: missing ( ) ) {
371369 Visible :: Yes => false ,
372370 Visible :: Editable => true ,
373371 Visible :: No => return ,
@@ -380,14 +378,13 @@ impl Completions {
380378 . import_to_add ( Some ( import) ) ,
381379 dot_access,
382380 None ,
383- None ,
384381 func,
385382 )
386383 . add_to ( self , ctx. db ) ;
387384 }
388385
389386 pub ( crate ) fn add_const ( & mut self , ctx : & CompletionContext < ' _ , ' _ > , konst : hir:: Const ) {
390- let is_private_editable = match ctx. is_visible ( & konst) {
387+ let is_private_editable = match ctx. is_visible ( & konst, & Name :: missing ( ) ) {
391388 Visible :: Yes => false ,
392389 Visible :: Editable => true ,
393390 Visible :: No => return ,
@@ -403,7 +400,7 @@ impl Completions {
403400 ctx : & CompletionContext < ' _ , ' _ > ,
404401 type_alias : hir:: TypeAlias ,
405402 ) {
406- let is_private_editable = match ctx. is_visible ( & type_alias) {
403+ let is_private_editable = match ctx. is_visible ( & type_alias, & Name :: missing ( ) ) {
407404 Visible :: Yes => false ,
408405 Visible :: Editable => true ,
409406 Visible :: No => return ,
@@ -432,7 +429,7 @@ impl Completions {
432429 variant : hir:: EnumVariant ,
433430 path : hir:: ModPath ,
434431 ) {
435- if !ctx. check_stability_and_hidden ( variant) {
432+ if !ctx. check_stability_and_hidden ( variant, & Name :: missing ( ) ) {
436433 return ;
437434 }
438435 if let Some ( builder) =
@@ -449,7 +446,7 @@ impl Completions {
449446 variant : hir:: EnumVariant ,
450447 local_name : Option < hir:: Name > ,
451448 ) {
452- if !ctx. check_stability_and_hidden ( variant) {
449+ if !ctx. check_stability_and_hidden ( variant, & Name :: missing ( ) ) {
453450 return ;
454451 }
455452 if let PathCompletionCtx { kind : PathKind :: Pat { pat_ctx } , .. } = path_ctx {
@@ -473,7 +470,7 @@ impl Completions {
473470 field : hir:: Field ,
474471 ty : & hir:: Type < ' _ > ,
475472 ) {
476- let is_private_editable = match ctx. is_visible ( & field) {
473+ let is_private_editable = match ctx. is_visible ( & field, & Name :: missing ( ) ) {
477474 Visible :: Yes => false ,
478475 Visible :: Editable => true ,
479476 Visible :: No => return ,
@@ -497,7 +494,7 @@ impl Completions {
497494 path : Option < hir:: ModPath > ,
498495 local_name : Option < hir:: Name > ,
499496 ) {
500- let is_private_editable = match ctx. is_visible ( & strukt) {
497+ let is_private_editable = match ctx. is_visible ( & strukt, & Name :: missing ( ) ) {
501498 Visible :: Yes => false ,
502499 Visible :: Editable => true ,
503500 Visible :: No => return ,
@@ -520,7 +517,7 @@ impl Completions {
520517 path : Option < hir:: ModPath > ,
521518 local_name : Option < hir:: Name > ,
522519 ) {
523- let is_private_editable = match ctx. is_visible ( & un) {
520+ let is_private_editable = match ctx. is_visible ( & un, & Name :: missing ( ) ) {
524521 Visible :: Yes => false ,
525522 Visible :: Editable => true ,
526523 Visible :: No => return ,
@@ -575,7 +572,7 @@ impl Completions {
575572 variant : hir:: EnumVariant ,
576573 local_name : Option < hir:: Name > ,
577574 ) {
578- if !ctx. check_stability_and_hidden ( variant) {
575+ if !ctx. check_stability_and_hidden ( variant, & Name :: missing ( ) ) {
579576 return ;
580577 }
581578 self . add_opt ( render_variant_pat (
@@ -595,7 +592,7 @@ impl Completions {
595592 variant : hir:: EnumVariant ,
596593 path : hir:: ModPath ,
597594 ) {
598- if !ctx. check_stability_and_hidden ( variant) {
595+ if !ctx. check_stability_and_hidden ( variant, & Name :: missing ( ) ) {
599596 return ;
600597 }
601598 let path = Some ( & path) ;
@@ -616,7 +613,7 @@ impl Completions {
616613 strukt : hir:: Struct ,
617614 local_name : Option < hir:: Name > ,
618615 ) {
619- let is_private_editable = match ctx. is_visible ( & strukt) {
616+ let is_private_editable = match ctx. is_visible ( & strukt, & Name :: missing ( ) ) {
620617 Visible :: Yes => false ,
621618 Visible :: Editable => true ,
622619 Visible :: No => return ,
0 commit comments