diff options
Diffstat (limited to 'crates/ra_analysis/src/hir/module/mod.rs')
-rw-r--r-- | crates/ra_analysis/src/hir/module/mod.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_analysis/src/hir/module/mod.rs b/crates/ra_analysis/src/hir/module/mod.rs index 55b6639be..4d5945b1a 100644 --- a/crates/ra_analysis/src/hir/module/mod.rs +++ b/crates/ra_analysis/src/hir/module/mod.rs | |||
@@ -196,7 +196,7 @@ pub(crate) struct ModuleTree { | |||
196 | } | 196 | } |
197 | 197 | ||
198 | impl ModuleTree { | 198 | impl ModuleTree { |
199 | fn modules<'a>(&'a self) -> impl Iterator<Item = ModuleId> + 'a { | 199 | pub(in crate::hir) fn modules<'a>(&'a self) -> impl Iterator<Item = ModuleId> + 'a { |
200 | self.mods.iter().map(|(id, _)| id) | 200 | self.mods.iter().map(|(id, _)| id) |
201 | } | 201 | } |
202 | 202 | ||
@@ -224,7 +224,7 @@ pub(crate) enum ModuleSource { | |||
224 | 224 | ||
225 | /// An owned syntax node for a module. Unlike `ModuleSource`, | 225 | /// An owned syntax node for a module. Unlike `ModuleSource`, |
226 | /// this holds onto the AST for the whole file. | 226 | /// this holds onto the AST for the whole file. |
227 | enum ModuleSourceNode { | 227 | pub(crate) enum ModuleSourceNode { |
228 | SourceFile(ast::SourceFileNode), | 228 | SourceFile(ast::SourceFileNode), |
229 | Module(ast::ModuleNode), | 229 | Module(ast::ModuleNode), |
230 | } | 230 | } |
@@ -244,7 +244,7 @@ pub enum Problem { | |||
244 | } | 244 | } |
245 | 245 | ||
246 | impl ModuleId { | 246 | impl ModuleId { |
247 | fn source(self, tree: &ModuleTree) -> ModuleSource { | 247 | pub(in crate::hir) fn source(self, tree: &ModuleTree) -> ModuleSource { |
248 | tree.mods[self].source | 248 | tree.mods[self].source |
249 | } | 249 | } |
250 | fn parent_link(self, tree: &ModuleTree) -> Option<LinkId> { | 250 | fn parent_link(self, tree: &ModuleTree) -> Option<LinkId> { |
@@ -318,7 +318,7 @@ pub(crate) struct ModuleData { | |||
318 | } | 318 | } |
319 | 319 | ||
320 | impl ModuleSource { | 320 | impl ModuleSource { |
321 | fn new_inline(file_id: FileId, module: ast::Module) -> ModuleSource { | 321 | pub(crate) fn new_inline(file_id: FileId, module: ast::Module) -> ModuleSource { |
322 | assert!(!module.has_semi()); | 322 | assert!(!module.has_semi()); |
323 | let ptr = SyntaxPtr::new(file_id, module.syntax()); | 323 | let ptr = SyntaxPtr::new(file_id, module.syntax()); |
324 | ModuleSource::Module(ptr) | 324 | ModuleSource::Module(ptr) |
@@ -338,7 +338,7 @@ impl ModuleSource { | |||
338 | } | 338 | } |
339 | } | 339 | } |
340 | 340 | ||
341 | fn resolve(self, db: &impl SyntaxDatabase) -> ModuleSourceNode { | 341 | pub(crate) fn resolve(self, db: &impl SyntaxDatabase) -> ModuleSourceNode { |
342 | match self { | 342 | match self { |
343 | ModuleSource::SourceFile(file_id) => { | 343 | ModuleSource::SourceFile(file_id) => { |
344 | let syntax = db.file_syntax(file_id); | 344 | let syntax = db.file_syntax(file_id); |