aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-11-20 11:58:01 +0000
committerAleksey Kladov <[email protected]>2018-11-20 11:58:01 +0000
commit099da13f531c84a7c69fbf5eed6a658bf64b531b (patch)
tree2c0d8ce777cc380223cfca91d408de96ea632b5c
parent4e683d7af1d752f2d7bc6e2ed4d6b85405bc84a8 (diff)
Make some queries private
Convention: we prefix private queries with `_` until salsa support real visibility.
-rw-r--r--crates/ra_analysis/src/db.rs4
-rw-r--r--crates/ra_analysis/src/descriptors/function/imp.rs2
-rw-r--r--crates/ra_analysis/src/descriptors/mod.rs17
-rw-r--r--crates/ra_analysis/src/descriptors/module/imp.rs2
4 files changed, 13 insertions, 12 deletions
diff --git a/crates/ra_analysis/src/db.rs b/crates/ra_analysis/src/db.rs
index d78b6afb9..8133b7875 100644
--- a/crates/ra_analysis/src/db.rs
+++ b/crates/ra_analysis/src/db.rs
@@ -85,10 +85,10 @@ salsa::database_storage! {
85 } 85 }
86 impl DescriptorDatabase { 86 impl DescriptorDatabase {
87 fn module_tree() for ModuleTreeQuery; 87 fn module_tree() for ModuleTreeQuery;
88 fn module_descriptor() for SubmodulesQuery;
89 fn module_scope() for ModuleScopeQuery; 88 fn module_scope() for ModuleScopeQuery;
90 fn fn_syntax() for FnSyntaxQuery;
91 fn fn_scopes() for FnScopesQuery; 89 fn fn_scopes() for FnScopesQuery;
90 fn _fn_syntax() for FnSyntaxQuery;
91 fn _submodules() for SubmodulesQuery;
92 } 92 }
93 } 93 }
94} 94}
diff --git a/crates/ra_analysis/src/descriptors/function/imp.rs b/crates/ra_analysis/src/descriptors/function/imp.rs
index a7257acf9..e09deba0f 100644
--- a/crates/ra_analysis/src/descriptors/function/imp.rs
+++ b/crates/ra_analysis/src/descriptors/function/imp.rs
@@ -15,7 +15,7 @@ pub(crate) fn fn_syntax(db: &impl DescriptorDatabase, fn_id: FnId) -> FnDefNode
15} 15}
16 16
17pub(crate) fn fn_scopes(db: &impl DescriptorDatabase, fn_id: FnId) -> Arc<FnScopes> { 17pub(crate) fn fn_scopes(db: &impl DescriptorDatabase, fn_id: FnId) -> Arc<FnScopes> {
18 let syntax = db.fn_syntax(fn_id); 18 let syntax = db._fn_syntax(fn_id);
19 let res = FnScopes::new(syntax.borrowed()); 19 let res = FnScopes::new(syntax.borrowed());
20 Arc::new(res) 20 Arc::new(res)
21} 21}
diff --git a/crates/ra_analysis/src/descriptors/mod.rs b/crates/ra_analysis/src/descriptors/mod.rs
index d602c4e04..f47ac49c5 100644
--- a/crates/ra_analysis/src/descriptors/mod.rs
+++ b/crates/ra_analysis/src/descriptors/mod.rs
@@ -24,23 +24,24 @@ salsa::query_group! {
24 type ModuleTreeQuery; 24 type ModuleTreeQuery;
25 use fn module::imp::module_tree; 25 use fn module::imp::module_tree;
26 } 26 }
27 fn submodules(source: ModuleSource) -> Cancelable<Arc<Vec<module::imp::Submodule>>> {
28 type SubmodulesQuery;
29 use fn module::imp::submodules;
30 }
31 fn module_scope(source_root_id: SourceRootId, module_id: ModuleId) -> Cancelable<Arc<ModuleScope>> { 27 fn module_scope(source_root_id: SourceRootId, module_id: ModuleId) -> Cancelable<Arc<ModuleScope>> {
32 type ModuleScopeQuery; 28 type ModuleScopeQuery;
33 use fn module::imp::module_scope; 29 use fn module::imp::module_scope;
34 } 30 }
35 fn fn_syntax(fn_id: FnId) -> FnDefNode { 31 fn fn_scopes(fn_id: FnId) -> Arc<FnScopes> {
32 type FnScopesQuery;
33 use fn function::imp::fn_scopes;
34 }
35
36 fn _fn_syntax(fn_id: FnId) -> FnDefNode {
36 type FnSyntaxQuery; 37 type FnSyntaxQuery;
37 // Don't retain syntax trees in memory 38 // Don't retain syntax trees in memory
38 storage volatile; 39 storage volatile;
39 use fn function::imp::fn_syntax; 40 use fn function::imp::fn_syntax;
40 } 41 }
41 fn fn_scopes(fn_id: FnId) -> Arc<FnScopes> { 42 fn _submodules(source: ModuleSource) -> Cancelable<Arc<Vec<module::imp::Submodule>>> {
42 type FnScopesQuery; 43 type SubmodulesQuery;
43 use fn function::imp::fn_scopes; 44 use fn module::imp::submodules;
44 } 45 }
45 } 46 }
46} 47}
diff --git a/crates/ra_analysis/src/descriptors/module/imp.rs b/crates/ra_analysis/src/descriptors/module/imp.rs
index ade96ddc0..ec0885938 100644
--- a/crates/ra_analysis/src/descriptors/module/imp.rs
+++ b/crates/ra_analysis/src/descriptors/module/imp.rs
@@ -155,7 +155,7 @@ fn build_subtree(
155 parent, 155 parent,
156 children: Vec::new(), 156 children: Vec::new(),
157 }); 157 });
158 for sub in db.submodules(source)?.iter() { 158 for sub in db._submodules(source)?.iter() {
159 let link = tree.push_link(LinkData { 159 let link = tree.push_link(LinkData {
160 name: sub.name().clone(), 160 name: sub.name().clone(),
161 owner: id, 161 owner: id,