diff options
Diffstat (limited to 'crates/ra_hir/src/module/mod.rs')
-rw-r--r-- | crates/ra_hir/src/module/mod.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/ra_hir/src/module/mod.rs b/crates/ra_hir/src/module/mod.rs index a011fd53e..3ae83d8cb 100644 --- a/crates/ra_hir/src/module/mod.rs +++ b/crates/ra_hir/src/module/mod.rs | |||
@@ -26,8 +26,7 @@ pub use self::nameres::ModuleScope; | |||
26 | pub struct Module { | 26 | pub struct Module { |
27 | tree: Arc<ModuleTree>, | 27 | tree: Arc<ModuleTree>, |
28 | source_root_id: SourceRootId, | 28 | source_root_id: SourceRootId, |
29 | //TODO: make private | 29 | module_id: ModuleId, |
30 | pub module_id: ModuleId, | ||
31 | } | 30 | } |
32 | 31 | ||
33 | impl Module { | 32 | impl Module { |
@@ -122,7 +121,6 @@ impl Module { | |||
122 | } | 121 | } |
123 | 122 | ||
124 | /// `name` is `None` for the crate's root module | 123 | /// `name` is `None` for the crate's root module |
125 | #[allow(unused)] | ||
126 | pub fn name(&self) -> Option<SmolStr> { | 124 | pub fn name(&self) -> Option<SmolStr> { |
127 | let link = self.module_id.parent_link(&self.tree)?; | 125 | let link = self.module_id.parent_link(&self.tree)?; |
128 | Some(link.name(&self.tree)) | 126 | Some(link.name(&self.tree)) |
@@ -218,7 +216,7 @@ pub enum ModuleSource { | |||
218 | 216 | ||
219 | /// An owned syntax node for a module. Unlike `ModuleSource`, | 217 | /// An owned syntax node for a module. Unlike `ModuleSource`, |
220 | /// this holds onto the AST for the whole file. | 218 | /// this holds onto the AST for the whole file. |
221 | pub enum ModuleSourceNode { | 219 | pub(crate) enum ModuleSourceNode { |
222 | SourceFile(ast::SourceFileNode), | 220 | SourceFile(ast::SourceFileNode), |
223 | Module(ast::ModuleNode), | 221 | Module(ast::ModuleNode), |
224 | } | 222 | } |
@@ -338,7 +336,7 @@ impl ModuleSource { | |||
338 | } | 336 | } |
339 | } | 337 | } |
340 | 338 | ||
341 | pub fn resolve(self, db: &impl HirDatabase) -> ModuleSourceNode { | 339 | pub(crate) fn resolve(self, db: &impl HirDatabase) -> ModuleSourceNode { |
342 | match self { | 340 | match self { |
343 | ModuleSource::SourceFile(file_id) => { | 341 | ModuleSource::SourceFile(file_id) => { |
344 | let syntax = db.source_file(file_id); | 342 | let syntax = db.source_file(file_id); |