Skip to content

Commit 6e2abbf

Browse files
authored
Merge pull request #19211 from Timmmm/user/timh/import_private
Include private items in completions for local crates
2 parents 49116c6 + 4ab9329 commit 6e2abbf

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • src/tools/rust-analyzer/crates/ide-completion/src/completions

‎src/tools/rust-analyzer/crates/ide-completion/src/completions/expr.rs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,10 @@ pub(crate) fn complete_expr_path(
147147
});
148148
match resolution {
149149
hir::PathResolution::Def(hir::ModuleDef::Module(module)) => {
150-
let module_scope = module.scope(ctx.db,Some(ctx.module));
150+
// Set visible_from to None so private items are returned.
151+
// They will be possibly filtered out in add_path_resolution()
152+
// via def_is_visible().
153+
let module_scope = module.scope(ctx.db,None);
151154
for(name, def)in module_scope {
152155
ifscope_def_applicable(def){
153156
acc.add_path_resolution(

0 commit comments

Comments
 (0)