From 099da13f531c84a7c69fbf5eed6a658bf64b531b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 20 Nov 2018 14:58:01 +0300 Subject: Make some queries private Convention: we prefix private queries with `_` until salsa support real visibility. --- crates/ra_analysis/src/db.rs | 4 ++-- crates/ra_analysis/src/descriptors/function/imp.rs | 2 +- crates/ra_analysis/src/descriptors/mod.rs | 17 +++++++++-------- crates/ra_analysis/src/descriptors/module/imp.rs | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) (limited to 'crates/ra_analysis') 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! { } impl DescriptorDatabase { fn module_tree() for ModuleTreeQuery; - fn module_descriptor() for SubmodulesQuery; fn module_scope() for ModuleScopeQuery; - fn fn_syntax() for FnSyntaxQuery; fn fn_scopes() for FnScopesQuery; + fn _fn_syntax() for FnSyntaxQuery; + fn _submodules() for SubmodulesQuery; } } } 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 } pub(crate) fn fn_scopes(db: &impl DescriptorDatabase, fn_id: FnId) -> Arc { - let syntax = db.fn_syntax(fn_id); + let syntax = db._fn_syntax(fn_id); let res = FnScopes::new(syntax.borrowed()); Arc::new(res) } 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! { type ModuleTreeQuery; use fn module::imp::module_tree; } - fn submodules(source: ModuleSource) -> Cancelable>> { - type SubmodulesQuery; - use fn module::imp::submodules; - } fn module_scope(source_root_id: SourceRootId, module_id: ModuleId) -> Cancelable> { type ModuleScopeQuery; use fn module::imp::module_scope; } - fn fn_syntax(fn_id: FnId) -> FnDefNode { + fn fn_scopes(fn_id: FnId) -> Arc { + type FnScopesQuery; + use fn function::imp::fn_scopes; + } + + fn _fn_syntax(fn_id: FnId) -> FnDefNode { type FnSyntaxQuery; // Don't retain syntax trees in memory storage volatile; use fn function::imp::fn_syntax; } - fn fn_scopes(fn_id: FnId) -> Arc { - type FnScopesQuery; - use fn function::imp::fn_scopes; + fn _submodules(source: ModuleSource) -> Cancelable>> { + type SubmodulesQuery; + use fn module::imp::submodules; } } } 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( parent, children: Vec::new(), }); - for sub in db.submodules(source)?.iter() { + for sub in db._submodules(source)?.iter() { let link = tree.push_link(LinkData { name: sub.name().clone(), owner: id, -- cgit v1.2.3