diff options
author | Aleksey Kladov <[email protected]> | 2019-01-06 11:05:03 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-06 14:35:29 +0000 |
commit | 3c2cb89087c87f29ad3bc3856625b83017b7a294 (patch) | |
tree | 9bf8d9e271d9199ec4d11f4728c0591e0796e9cc /crates/ra_hir/src/code_model_api.rs | |
parent | 1836f4db35b29cd325b04978776a902679bd9ce6 (diff) |
add parent & resolve_path
Diffstat (limited to 'crates/ra_hir/src/code_model_api.rs')
-rw-r--r-- | crates/ra_hir/src/code_model_api.rs | 10 |
1 files changed, 9 insertions, 1 deletions
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 @@ | |||
1 | use ra_db::{CrateId, Cancelable, FileId}; | 1 | use ra_db::{CrateId, Cancelable, FileId}; |
2 | use ra_syntax::ast; | 2 | use ra_syntax::ast; |
3 | 3 | ||
4 | use crate::{Name, db::HirDatabase, DefId}; | 4 | use crate::{Name, db::HirDatabase, DefId, Path, PerNs}; |
5 | 5 | ||
6 | /// hir::Crate describes a single crate. It's the main inteface with which | 6 | /// hir::Crate describes a single crate. It's the main inteface with which |
7 | /// crate's dependencies interact. Mostly, it should be just a proxy for the | 7 | /// crate's dependencies interact. Mostly, it should be just a proxy for the |
@@ -52,4 +52,12 @@ impl Module { | |||
52 | pub fn child(&self, db: &impl HirDatabase, name: &Name) -> Cancelable<Option<Module>> { | 52 | pub fn child(&self, db: &impl HirDatabase, name: &Name) -> Cancelable<Option<Module>> { |
53 | self.child_impl(db, name) | 53 | self.child_impl(db, name) |
54 | } | 54 | } |
55 | /// Finds a parent module. | ||
56 | pub fn parent(&self, db: &impl HirDatabase) -> Cancelable<Option<Module>> { | ||
57 | self.parent_impl(db) | ||
58 | } | ||
59 | |||
60 | pub fn resolve_path(&self, db: &impl HirDatabase, path: &Path) -> Cancelable<PerNs<DefId>> { | ||
61 | self.resolve_path_impl(db, path) | ||
62 | } | ||
55 | } | 63 | } |