Merge pull request #19211 from Timmmm/user/timh/import_private

Include private items in completions for local crates
This commit is contained in:
Lukas Wirth 2025-02-24 13:13:31 +00:00 committed by GitHub
commit 6e2abbfcc3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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(