diff options
author | Aleksey Kladov <[email protected]> | 2018-11-20 11:58:01 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-11-20 11:58:01 +0000 |
commit | 099da13f531c84a7c69fbf5eed6a658bf64b531b (patch) | |
tree | 2c0d8ce777cc380223cfca91d408de96ea632b5c /crates/ra_analysis/src/descriptors | |
parent | 4e683d7af1d752f2d7bc6e2ed4d6b85405bc84a8 (diff) |
Make some queries private
Convention: we prefix private queries with `_` until salsa support
real visibility.
Diffstat (limited to 'crates/ra_analysis/src/descriptors')
-rw-r--r-- | crates/ra_analysis/src/descriptors/function/imp.rs | 2 | ||||
-rw-r--r-- | crates/ra_analysis/src/descriptors/mod.rs | 17 | ||||
-rw-r--r-- | crates/ra_analysis/src/descriptors/module/imp.rs | 2 |
3 files changed, 11 insertions, 10 deletions
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 | ||
17 | pub(crate) fn fn_scopes(db: &impl DescriptorDatabase, fn_id: FnId) -> Arc<FnScopes> { | 17 | pub(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, |