about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2025-02-24 13:13:31 +0000
committerGitHub <noreply@github.com>2025-02-24 13:13:31 +0000
commit6e2abbfcc353e95534fa01600c65ba24428abfd3 (patch)
tree74b987615ad26e3432859b9c62f6adf6bc495f64
parent49116c6fdcf8b144d26ae406bc541bf0e9cde881 (diff)
parent4ab9329699392901e7b0f2b3000923a6e15380cb (diff)
downloadrust-6e2abbfcc353e95534fa01600c65ba24428abfd3.tar.gz
rust-6e2abbfcc353e95534fa01600c65ba24428abfd3.zip
Merge pull request #19211 from Timmmm/user/timh/import_private
Include private items in completions for local crates
-rw-r--r--src/tools/rust-analyzer/crates/ide-completion/src/completions/expr.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tools/rust-analyzer/crates/ide-completion/src/completions/expr.rs b/src/tools/rust-analyzer/crates/ide-completion/src/completions/expr.rs
index e7101751701..365d2dde7e9 100644
--- a/src/tools/rust-analyzer/crates/ide-completion/src/completions/expr.rs
+++ b/src/tools/rust-analyzer/crates/ide-completion/src/completions/expr.rs
@@ -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(