[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

@ -187,7 +187,10 @@ impl HasNavigationTargets for Type<'_> {
impl HasNavigationTargets for TypeDefinition<'_> {
fn navigation_targets(&self, db: &dyn Db) -> NavigationTargets {
let full_range = self.full_range(db.upcast());
let Some(full_range) = self.full_range(db.upcast()) else {
return NavigationTargets::empty();
};
NavigationTargets::single(NavigationTarget {
file: full_range.file(),
focus_range: self.focus_range(db.upcast()).unwrap_or(full_range).range(),