mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-02 06:42:02 +00:00
[ty] Support import <namespace>
and from <namespace> import module
(#18137)
This commit is contained in:
parent
7b253100f8
commit
76ab77fe01
16 changed files with 359 additions and 158 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue