diff options
Diffstat (limited to 'crates/ra_hir/src/db.rs')
-rw-r--r-- | crates/ra_hir/src/db.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/ra_hir/src/db.rs b/crates/ra_hir/src/db.rs index d94f75857..e7f9afa77 100644 --- a/crates/ra_hir/src/db.rs +++ b/crates/ra_hir/src/db.rs | |||
@@ -1,6 +1,7 @@ | |||
1 | use std::sync::Arc; | 1 | use std::sync::Arc; |
2 | 2 | ||
3 | use ra_syntax::{ | 3 | use ra_syntax::{ |
4 | SmolStr, | ||
4 | SyntaxNode, | 5 | SyntaxNode, |
5 | ast::FnDefNode, | 6 | ast::FnDefNode, |
6 | }; | 7 | }; |
@@ -15,6 +16,7 @@ use crate::{ | |||
15 | module::{ModuleId, ModuleTree, ModuleSource, | 16 | module::{ModuleId, ModuleTree, ModuleSource, |
16 | nameres::{ItemMap, InputModuleItems}}, | 17 | nameres::{ItemMap, InputModuleItems}}, |
17 | ty::{InferenceResult, Ty}, | 18 | ty::{InferenceResult, Ty}, |
19 | adt::{StructData, EnumData}, | ||
18 | }; | 20 | }; |
19 | 21 | ||
20 | salsa::query_group! { | 22 | salsa::query_group! { |
@@ -31,6 +33,16 @@ pub trait HirDatabase: SyntaxDatabase | |||
31 | use fn query_definitions::fn_syntax; | 33 | use fn query_definitions::fn_syntax; |
32 | } | 34 | } |
33 | 35 | ||
36 | fn struct_data(def_id: DefId) -> Cancelable<Arc<StructData>> { | ||
37 | type StructDataQuery; | ||
38 | use fn query_definitions::struct_data; | ||
39 | } | ||
40 | |||
41 | fn enum_data(def_id: DefId) -> Cancelable<Arc<EnumData>> { | ||
42 | type EnumDataQuery; | ||
43 | use fn query_definitions::enum_data; | ||
44 | } | ||
45 | |||
34 | fn infer(fn_id: FnId) -> Cancelable<Arc<InferenceResult>> { | 46 | fn infer(fn_id: FnId) -> Cancelable<Arc<InferenceResult>> { |
35 | type InferQuery; | 47 | type InferQuery; |
36 | use fn query_definitions::infer; | 48 | use fn query_definitions::infer; |
@@ -41,6 +53,11 @@ pub trait HirDatabase: SyntaxDatabase | |||
41 | use fn query_definitions::type_for_def; | 53 | use fn query_definitions::type_for_def; |
42 | } | 54 | } |
43 | 55 | ||
56 | fn type_for_field(def_id: DefId, field: SmolStr) -> Cancelable<Ty> { | ||
57 | type TypeForFieldQuery; | ||
58 | use fn query_definitions::type_for_field; | ||
59 | } | ||
60 | |||
44 | fn file_items(file_id: FileId) -> Arc<SourceFileItems> { | 61 | fn file_items(file_id: FileId) -> Arc<SourceFileItems> { |
45 | type SourceFileItemsQuery; | 62 | type SourceFileItemsQuery; |
46 | use fn query_definitions::file_items; | 63 | use fn query_definitions::file_items; |