mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Some more fragment fixes
This commit is contained in:
parent
e8f1abf5f7
commit
cb7b4a5d5b
5 changed files with 115 additions and 148 deletions
|
@ -303,6 +303,13 @@ impl ModuleDef {
|
|||
Some(segments.into_iter().join("::"))
|
||||
}
|
||||
|
||||
pub fn canonical_module_path(
|
||||
&self,
|
||||
db: &dyn HirDatabase,
|
||||
) -> Option<impl Iterator<Item = Module>> {
|
||||
self.module(db).map(|it| it.path_to_root(db).into_iter().rev())
|
||||
}
|
||||
|
||||
pub fn name(self, db: &dyn HirDatabase) -> Option<Name> {
|
||||
match self {
|
||||
ModuleDef::Adt(it) => Some(it.name(db)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue