use std::sync::Arc; use ra_syntax::{ SyntaxNode, ast::FnDefNode, }; use ra_db::{SourceRootId, LocationIntener, SyntaxDatabase}; use crate::{ FileId, hir::{ SourceFileItems, SourceItemId, query_definitions, function::{FnScopes}, module::{ModuleId, ModuleTree, ModuleSource, nameres::{ItemMap, InputModuleItems}}, }, loc2id::{DefLoc, DefId, FnId}, Cancelable, }; salsa::query_group! { pub(crate) trait HirDatabase: SyntaxDatabase + AsRef> + AsRef> { fn fn_scopes(fn_id: FnId) -> Arc { type FnScopesQuery; use fn query_definitions::fn_scopes; } fn fn_syntax(fn_id: FnId) -> FnDefNode { type FnSyntaxQuery; // Don't retain syntax trees in memory storage dependencies; use fn query_definitions::fn_syntax; } fn file_items(file_id: FileId) -> Arc { type SourceFileItemsQuery; storage dependencies; use fn query_definitions::file_items; } fn file_item(source_item_id: SourceItemId) -> SyntaxNode { type FileItemQuery; storage dependencies; use fn query_definitions::file_item; } fn submodules(source: ModuleSource) -> Cancelable>> { type SubmodulesQuery; use fn query_definitions::submodules; } fn input_module_items(source_root_id: SourceRootId, module_id: ModuleId) -> Cancelable> { type InputModuleItemsQuery; use fn query_definitions::input_module_items; } fn item_map(source_root_id: SourceRootId) -> Cancelable> { type ItemMapQuery; use fn query_definitions::item_map; } fn module_tree(source_root_id: SourceRootId) -> Cancelable> { type ModuleTreeQuery; use fn crate::hir::module::imp::module_tree; } } }