Skip to content

Commit bb78d31

Browse files
committed
Add doc comment for resolve_hir_path_qualifier
1 parent 001a86d commit bb78d31

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

crates/ra_hir/src/semantics.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,19 @@ impl<'a, DB: HirDatabase> SemanticsScope<'a, DB> {
452452
resolve_hir_path(self.db, &self.resolver, path)
453453
}
454454

455+
/// Resolves a path where we know it is a qualifier of another path.
456+
///
457+
/// For example, if we have:
458+
/// ```
459+
/// mod my {
460+
/// pub mod foo {
461+
/// struct Bar;
462+
/// }
463+
///
464+
/// pub fn foo() {}
465+
/// }
466+
/// ```
467+
/// then we know that `foo` in `my::foo::Bar` refers to the module, not the function.
455468
pub fn resolve_hir_path_qualifier(&self, path: &Path) -> Option<PathResolution> {
456469
resolve_hir_path_qualifier(self.db, &self.resolver, path)
457470
}

0 commit comments

Comments
 (0)