diff options
author | Aleksey Kladov <[email protected]> | 2019-01-06 10:41:12 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-06 14:35:29 +0000 |
commit | 61687b9db67d34bbcce8596496448c0717d98316 (patch) | |
tree | 2b0b6ab5288e5d50230604298a86f76028cc3aa8 /crates/ra_hir/src/code_model_api.rs | |
parent | 8c4d2770362f3c2950f110f8e116ed8f537ec1a1 (diff) |
fix tests
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 63e2e34e8..2f968d97c 100644 --- a/crates/ra_hir/src/code_model_api.rs +++ b/crates/ra_hir/src/code_model_api.rs | |||
@@ -1,4 +1,5 @@ | |||
1 | use ra_db::{CrateId, Cancelable}; | 1 | use ra_db::{CrateId, Cancelable, FileId}; |
2 | use ra_syntax::ast; | ||
2 | 3 | ||
3 | use crate::{Name, db::HirDatabase, DefId}; | 4 | use crate::{Name, db::HirDatabase, DefId}; |
4 | 5 | ||
@@ -17,6 +18,9 @@ pub struct CrateDependency { | |||
17 | } | 18 | } |
18 | 19 | ||
19 | impl Crate { | 20 | impl Crate { |
21 | pub fn crate_id(&self) -> CrateId { | ||
22 | self.crate_id | ||
23 | } | ||
20 | pub fn dependencies(&self, db: &impl HirDatabase) -> Vec<CrateDependency> { | 24 | pub fn dependencies(&self, db: &impl HirDatabase) -> Vec<CrateDependency> { |
21 | self.dependencies_impl(db) | 25 | self.dependencies_impl(db) |
22 | } | 26 | } |
@@ -31,6 +35,10 @@ pub struct Module { | |||
31 | } | 35 | } |
32 | 36 | ||
33 | impl Module { | 37 | impl Module { |
38 | pub fn source(&self, db: &impl HirDatabase) -> (FileId, Option<ast::ModuleNode>) { | ||
39 | self.source_impl(db) | ||
40 | } | ||
41 | |||
34 | /// Returns the crate this module is part of. | 42 | /// Returns the crate this module is part of. |
35 | pub fn krate(&self, db: &impl HirDatabase) -> Cancelable<Option<Crate>> { | 43 | pub fn krate(&self, db: &impl HirDatabase) -> Cancelable<Option<Crate>> { |
36 | self.krate_impl(db) | 44 | self.krate_impl(db) |