[ty] Support import <namespace> and from <namespace> import module (#18137)

This commit is contained in:
Micha Reiser 2025-05-21 09:28:33 +02:00 committed by GitHub
parent 7b253100f8
commit 76ab77fe01
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 359 additions and 158 deletions

View file

@ -1336,7 +1336,9 @@ where
continue;
};
let referenced_module = module.file();
let Some(referenced_module) = module.file() else {
continue;
};
// In order to understand the visibility of definitions created by a `*` import,
// we need to know the visibility of the global-scope definitions in the

View file

@ -244,7 +244,12 @@ impl<'db> Visitor<'db> for ExportFinder<'db> {
.ok()
.and_then(|module_name| resolve_module(self.db, &module_name))
.iter()
.flat_map(|module| exported_names(self.db, module.file()))
.flat_map(|module| {
module
.file()
.map(|file| exported_names(self.db, file))
.unwrap_or_default()
})
{
self.possibly_add_export(export, PossibleExportKind::Normal);
}