aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/hir/module/mod.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-11-27 20:33:36 +0000
committerAleksey Kladov <[email protected]>2018-11-27 20:33:36 +0000
commitb7049ea543d5ea9a965dfa51d9da923739f2420d (patch)
tree4cfda71ca655fc13479413825b452419fdc0e281 /crates/ra_analysis/src/hir/module/mod.rs
parent90bc832b22aefb2a382b3465793df7e528351aa1 (diff)
move query definitions
Diffstat (limited to 'crates/ra_analysis/src/hir/module/mod.rs')
-rw-r--r--crates/ra_analysis/src/hir/module/mod.rs10
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
198impl ModuleTree { 198impl 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.
227enum ModuleSourceNode { 227pub(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
246impl ModuleId { 246impl 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
320impl ModuleSource { 320impl 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);