From 3c2cb89087c87f29ad3bc3856625b83017b7a294 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 6 Jan 2019 14:05:03 +0300 Subject: add parent & resolve_path --- crates/ra_hir/src/code_model_api.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'crates/ra_hir/src/code_model_api.rs') diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs index 6bbc80e17..236cb3ab4 100644 --- a/crates/ra_hir/src/code_model_api.rs +++ b/crates/ra_hir/src/code_model_api.rs @@ -1,7 +1,7 @@ use ra_db::{CrateId, Cancelable, FileId}; use ra_syntax::ast; -use crate::{Name, db::HirDatabase, DefId}; +use crate::{Name, db::HirDatabase, DefId, Path, PerNs}; /// hir::Crate describes a single crate. It's the main inteface with which /// crate's dependencies interact. Mostly, it should be just a proxy for the @@ -52,4 +52,12 @@ impl Module { pub fn child(&self, db: &impl HirDatabase, name: &Name) -> Cancelable> { self.child_impl(db, name) } + /// Finds a parent module. + pub fn parent(&self, db: &impl HirDatabase) -> Cancelable> { + self.parent_impl(db) + } + + pub fn resolve_path(&self, db: &impl HirDatabase, path: &Path) -> Cancelable> { + self.resolve_path_impl(db, path) + } } -- cgit v1.2.3