mirror of
				https://github.com/rust-lang/rust-analyzer.git
				synced 2025-10-31 12:04:43 +00:00 
			
		
		
		
	Include private items in completions for local crates
Don't filter out private items when completing paths in the same crate. Instead respect the `privateEditable` setting. Fixes #9850
This commit is contained in:
		
							parent
							
								
									83ff2c91fa
								
							
						
					
					
						commit
						8d91f1cc17
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		|  | @ -147,7 +147,10 @@ pub(crate) fn complete_expr_path( | |||
|             }); | ||||
|             match resolution { | ||||
|                 hir::PathResolution::Def(hir::ModuleDef::Module(module)) => { | ||||
|                     let module_scope = module.scope(ctx.db, Some(ctx.module)); | ||||
|                     // Set visible_from to None so private items are returned.
 | ||||
|                     // They will be possibly filtered out in add_path_resolution()
 | ||||
|                     // via def_is_visible().
 | ||||
|                     let module_scope = module.scope(ctx.db, None); | ||||
|                     for (name, def) in module_scope { | ||||
|                         if scope_def_applicable(def) { | ||||
|                             acc.add_path_resolution( | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Tim Hutt
						Tim Hutt