mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Make some queries private
Convention: we prefix private queries with `_` until salsa support real visibility.
This commit is contained in:
parent
4e683d7af1
commit
099da13f53
4 changed files with 13 additions and 12 deletions
|
@ -85,10 +85,10 @@ salsa::database_storage! {
|
||||||
}
|
}
|
||||||
impl DescriptorDatabase {
|
impl DescriptorDatabase {
|
||||||
fn module_tree() for ModuleTreeQuery;
|
fn module_tree() for ModuleTreeQuery;
|
||||||
fn module_descriptor() for SubmodulesQuery;
|
|
||||||
fn module_scope() for ModuleScopeQuery;
|
fn module_scope() for ModuleScopeQuery;
|
||||||
fn fn_syntax() for FnSyntaxQuery;
|
|
||||||
fn fn_scopes() for FnScopesQuery;
|
fn fn_scopes() for FnScopesQuery;
|
||||||
|
fn _fn_syntax() for FnSyntaxQuery;
|
||||||
|
fn _submodules() for SubmodulesQuery;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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<FnScopes> {
|
pub(crate) fn fn_scopes(db: &impl DescriptorDatabase, fn_id: FnId) -> Arc<FnScopes> {
|
||||||
let syntax = db.fn_syntax(fn_id);
|
let syntax = db._fn_syntax(fn_id);
|
||||||
let res = FnScopes::new(syntax.borrowed());
|
let res = FnScopes::new(syntax.borrowed());
|
||||||
Arc::new(res)
|
Arc::new(res)
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,23 +24,24 @@ salsa::query_group! {
|
||||||
type ModuleTreeQuery;
|
type ModuleTreeQuery;
|
||||||
use fn module::imp::module_tree;
|
use fn module::imp::module_tree;
|
||||||
}
|
}
|
||||||
fn submodules(source: ModuleSource) -> Cancelable<Arc<Vec<module::imp::Submodule>>> {
|
|
||||||
type SubmodulesQuery;
|
|
||||||
use fn module::imp::submodules;
|
|
||||||
}
|
|
||||||
fn module_scope(source_root_id: SourceRootId, module_id: ModuleId) -> Cancelable<Arc<ModuleScope>> {
|
fn module_scope(source_root_id: SourceRootId, module_id: ModuleId) -> Cancelable<Arc<ModuleScope>> {
|
||||||
type ModuleScopeQuery;
|
type ModuleScopeQuery;
|
||||||
use fn module::imp::module_scope;
|
use fn module::imp::module_scope;
|
||||||
}
|
}
|
||||||
fn fn_syntax(fn_id: FnId) -> FnDefNode {
|
fn fn_scopes(fn_id: FnId) -> Arc<FnScopes> {
|
||||||
|
type FnScopesQuery;
|
||||||
|
use fn function::imp::fn_scopes;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn _fn_syntax(fn_id: FnId) -> FnDefNode {
|
||||||
type FnSyntaxQuery;
|
type FnSyntaxQuery;
|
||||||
// Don't retain syntax trees in memory
|
// Don't retain syntax trees in memory
|
||||||
storage volatile;
|
storage volatile;
|
||||||
use fn function::imp::fn_syntax;
|
use fn function::imp::fn_syntax;
|
||||||
}
|
}
|
||||||
fn fn_scopes(fn_id: FnId) -> Arc<FnScopes> {
|
fn _submodules(source: ModuleSource) -> Cancelable<Arc<Vec<module::imp::Submodule>>> {
|
||||||
type FnScopesQuery;
|
type SubmodulesQuery;
|
||||||
use fn function::imp::fn_scopes;
|
use fn module::imp::submodules;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,7 @@ fn build_subtree(
|
||||||
parent,
|
parent,
|
||||||
children: Vec::new(),
|
children: Vec::new(),
|
||||||
});
|
});
|
||||||
for sub in db.submodules(source)?.iter() {
|
for sub in db._submodules(source)?.iter() {
|
||||||
let link = tree.push_link(LinkData {
|
let link = tree.push_link(LinkData {
|
||||||
name: sub.name().clone(),
|
name: sub.name().clone(),
|
||||||
owner: id,
|
owner: id,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue