Skip to content

Commit cb7b4a5

Browse files
committed
Some more fragment fixes
1 parent e8f1abf commit cb7b4a5

File tree

5 files changed

+115
-148
lines changed

5 files changed

+115
-148
lines changed

crates/hir/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,13 @@ impl ModuleDef {
303303
Some(segments.into_iter().join("::"))
304304
}
305305

306+
pub fn canonical_module_path(
307+
&self,
308+
db: &dyn HirDatabase,
309+
) -> Option<impl Iterator<Item = Module>> {
310+
self.module(db).map(|it| it.path_to_root(db).into_iter().rev())
311+
}
312+
306313
pub fn name(self, db: &dyn HirDatabase) -> Option<Name> {
307314
match self {
308315
ModuleDef::Adt(it) => Some(it.name(db)),

0 commit comments

Comments
 (0)