use std::sync::Arc; use ra_syntax::SyntaxNode; use ra_db::{SourceRootId, LocationIntener, SyntaxDatabase, FileId, Cancelable}; use crate::{ DefLoc, DefId, Name, SourceFileItems, SourceItemId, query_definitions, FnScopes, module::{ModuleId, ModuleTree, ModuleSource, nameres::{ItemMap, InputModuleItems}}, ty::{InferenceResult, Ty}, adt::{StructData, EnumData}, }; salsa::query_group! { pub trait HirDatabase: SyntaxDatabase + AsRef> { fn fn_scopes(def_id: DefId) -> Arc { type FnScopesQuery; use fn query_definitions::fn_scopes; } fn struct_data(def_id: DefId) -> Cancelable> { type StructDataQuery; use fn query_definitions::struct_data; } fn enum_data(def_id: DefId) -> Cancelable> { type EnumDataQuery; use fn query_definitions::enum_data; } fn infer(def_id: DefId) -> Cancelable> { type InferQuery; use fn query_definitions::infer; } fn type_for_def(def_id: DefId) -> Cancelable { type TypeForDefQuery; use fn query_definitions::type_for_def; } fn type_for_field(def_id: DefId, field: Name) -> Cancelable { type TypeForFieldQuery; use fn query_definitions::type_for_field; } fn file_items(file_id: FileId) -> Arc { type SourceFileItemsQuery; use fn query_definitions::file_items; } fn file_item(source_item_id: SourceItemId) -> SyntaxNode { type FileItemQuery; 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::module::imp::module_tree; } } }