diff options
author | Aleksey Kladov <[email protected]> | 2019-01-06 12:16:21 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-06 14:35:57 +0000 |
commit | 9cb02fd931f436a7b39c33c752799f5530b8491b (patch) | |
tree | ddd8d882d7aa445457ae75e7c830280eefbc0250 /crates/ra_hir/src/code_model_api.rs | |
parent | 3c2cb89087c87f29ad3bc3856625b83017b7a294 (diff) |
kill old module
Diffstat (limited to 'crates/ra_hir/src/code_model_api.rs')
-rw-r--r-- | crates/ra_hir/src/code_model_api.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs index 236cb3ab4..eca7d0225 100644 --- a/crates/ra_hir/src/code_model_api.rs +++ b/crates/ra_hir/src/code_model_api.rs | |||
@@ -1,7 +1,6 @@ | |||
1 | use ra_db::{CrateId, Cancelable, FileId}; | 1 | use ra_db::{CrateId, Cancelable}; |
2 | use ra_syntax::ast; | ||
3 | 2 | ||
4 | use crate::{Name, db::HirDatabase, DefId, Path, PerNs}; | 3 | use crate::{Name, db::HirDatabase, DefId, Path, PerNs, module::{ModuleSource, ModuleScope}}; |
5 | 4 | ||
6 | /// hir::Crate describes a single crate. It's the main inteface with which | 5 | /// 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 | 6 | /// crate's dependencies interact. Mostly, it should be just a proxy for the |
@@ -35,7 +34,8 @@ pub struct Module { | |||
35 | } | 34 | } |
36 | 35 | ||
37 | impl Module { | 36 | impl Module { |
38 | pub fn source(&self, db: &impl HirDatabase) -> Cancelable<(FileId, Option<ast::ModuleNode>)> { | 37 | // FIXME: what is a module source exactly? It should contain two nodes |
38 | pub fn source(&self, db: &impl HirDatabase) -> Cancelable<ModuleSource> { | ||
39 | Ok(self.source_impl(db)) | 39 | Ok(self.source_impl(db)) |
40 | } | 40 | } |
41 | 41 | ||
@@ -56,7 +56,10 @@ impl Module { | |||
56 | pub fn parent(&self, db: &impl HirDatabase) -> Cancelable<Option<Module>> { | 56 | pub fn parent(&self, db: &impl HirDatabase) -> Cancelable<Option<Module>> { |
57 | self.parent_impl(db) | 57 | self.parent_impl(db) |
58 | } | 58 | } |
59 | 59 | /// Returns a `ModuleScope`: a set of items, visible in this module. | |
60 | pub fn scope(&self, db: &impl HirDatabase) -> Cancelable<ModuleScope> { | ||
61 | self.scope_impl(db) | ||
62 | } | ||
60 | pub fn resolve_path(&self, db: &impl HirDatabase, path: &Path) -> Cancelable<PerNs<DefId>> { | 63 | pub fn resolve_path(&self, db: &impl HirDatabase, path: &Path) -> Cancelable<PerNs<DefId>> { |
61 | self.resolve_path_impl(db, path) | 64 | self.resolve_path_impl(db, path) |
62 | } | 65 | } |