mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 21:34:57 +00:00
[ty] Fix a bug with "all_submodule_names_for_package" API
The names of the submodules returned should be *complete*. This is the contract of `Module::name`. However, we were previously only returning the basename of the submodule.
This commit is contained in:
parent
cf16fc4aa4
commit
6ec52991cb
3 changed files with 21 additions and 14 deletions
|
@ -203,7 +203,9 @@ fn all_submodule_names_for_package<'db>(
|
|||
})
|
||||
.filter_map(|entry| {
|
||||
let stem = entry.path().file_stem()?;
|
||||
let name = ModuleName::new(stem)?;
|
||||
let mut name = module.name(db).clone();
|
||||
name.extend(&ModuleName::new(stem)?);
|
||||
|
||||
let (kind, file) = if entry.file_type().is_directory() {
|
||||
(
|
||||
ModuleKind::Package,
|
||||
|
@ -239,7 +241,9 @@ fn all_submodule_names_for_package<'db>(
|
|||
})
|
||||
.filter_map(|entry| {
|
||||
let stem = entry.path().file_stem()?;
|
||||
let name = ModuleName::new(stem)?;
|
||||
let mut name = module.name(db).clone();
|
||||
name.extend(&ModuleName::new(stem)?);
|
||||
|
||||
let (kind, file) = if entry.file_type().is_directory() {
|
||||
(
|
||||
ModuleKind::Package,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue