From bb78d314e15999a68f5eb865486824966c13402f Mon Sep 17 00:00:00 2001 From: Hasan Ali Date: Sat, 16 May 2020 20:40:58 +0100 Subject: Add doc comment for resolve_hir_path_qualifier --- crates/ra_hir/src/semantics.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'crates') diff --git a/crates/ra_hir/src/semantics.rs b/crates/ra_hir/src/semantics.rs index c1129a494..7c1f79f27 100644 --- a/crates/ra_hir/src/semantics.rs +++ b/crates/ra_hir/src/semantics.rs @@ -452,6 +452,19 @@ impl<'a, DB: HirDatabase> SemanticsScope<'a, DB> { resolve_hir_path(self.db, &self.resolver, path) } + /// Resolves a path where we know it is a qualifier of another path. + /// + /// For example, if we have: + /// ``` + /// mod my { + /// pub mod foo { + /// struct Bar; + /// } + /// + /// pub fn foo() {} + /// } + /// ``` + /// then we know that `foo` in `my::foo::Bar` refers to the module, not the function. pub fn resolve_hir_path_qualifier(&self, path: &Path) -> Option { resolve_hir_path_qualifier(self.db, &self.resolver, path) } -- cgit v1.2.3