diff options
Diffstat (limited to 'crates/ra_hir/src/db.rs')
-rw-r--r-- | crates/ra_hir/src/db.rs | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/crates/ra_hir/src/db.rs b/crates/ra_hir/src/db.rs index e7f9afa77..5a8ca3b47 100644 --- a/crates/ra_hir/src/db.rs +++ b/crates/ra_hir/src/db.rs | |||
@@ -1,18 +1,13 @@ | |||
1 | use std::sync::Arc; | 1 | use std::sync::Arc; |
2 | 2 | ||
3 | use ra_syntax::{ | 3 | use ra_syntax::SyntaxNode; |
4 | SmolStr, | ||
5 | SyntaxNode, | ||
6 | ast::FnDefNode, | ||
7 | }; | ||
8 | use ra_db::{SourceRootId, LocationIntener, SyntaxDatabase, FileId, Cancelable}; | 4 | use ra_db::{SourceRootId, LocationIntener, SyntaxDatabase, FileId, Cancelable}; |
9 | 5 | ||
10 | use crate::{ | 6 | use crate::{ |
11 | DefLoc, DefId, | 7 | DefLoc, DefId, Name, |
12 | SourceFileItems, SourceItemId, | 8 | SourceFileItems, SourceItemId, |
13 | query_definitions, | 9 | query_definitions, |
14 | FnScopes, | 10 | FnScopes, |
15 | function::FnId, | ||
16 | module::{ModuleId, ModuleTree, ModuleSource, | 11 | module::{ModuleId, ModuleTree, ModuleSource, |
17 | nameres::{ItemMap, InputModuleItems}}, | 12 | nameres::{ItemMap, InputModuleItems}}, |
18 | ty::{InferenceResult, Ty}, | 13 | ty::{InferenceResult, Ty}, |
@@ -24,14 +19,10 @@ salsa::query_group! { | |||
24 | pub trait HirDatabase: SyntaxDatabase | 19 | pub trait HirDatabase: SyntaxDatabase |
25 | + AsRef<LocationIntener<DefLoc, DefId>> | 20 | + AsRef<LocationIntener<DefLoc, DefId>> |
26 | { | 21 | { |
27 | fn fn_scopes(fn_id: FnId) -> Arc<FnScopes> { | 22 | fn fn_scopes(def_id: DefId) -> Arc<FnScopes> { |
28 | type FnScopesQuery; | 23 | type FnScopesQuery; |
29 | use fn query_definitions::fn_scopes; | 24 | use fn query_definitions::fn_scopes; |
30 | } | 25 | } |
31 | fn fn_syntax(fn_id: FnId) -> FnDefNode { | ||
32 | type FnSyntaxQuery; | ||
33 | use fn query_definitions::fn_syntax; | ||
34 | } | ||
35 | 26 | ||
36 | fn struct_data(def_id: DefId) -> Cancelable<Arc<StructData>> { | 27 | fn struct_data(def_id: DefId) -> Cancelable<Arc<StructData>> { |
37 | type StructDataQuery; | 28 | type StructDataQuery; |
@@ -43,19 +34,19 @@ pub trait HirDatabase: SyntaxDatabase | |||
43 | use fn query_definitions::enum_data; | 34 | use fn query_definitions::enum_data; |
44 | } | 35 | } |
45 | 36 | ||
46 | fn infer(fn_id: FnId) -> Cancelable<Arc<InferenceResult>> { | 37 | fn infer(def_id: DefId) -> Cancelable<Arc<InferenceResult>> { |
47 | type InferQuery; | 38 | type InferQuery; |
48 | use fn query_definitions::infer; | 39 | use fn crate::ty::infer; |
49 | } | 40 | } |
50 | 41 | ||
51 | fn type_for_def(def_id: DefId) -> Cancelable<Ty> { | 42 | fn type_for_def(def_id: DefId) -> Cancelable<Ty> { |
52 | type TypeForDefQuery; | 43 | type TypeForDefQuery; |
53 | use fn query_definitions::type_for_def; | 44 | use fn crate::ty::type_for_def; |
54 | } | 45 | } |
55 | 46 | ||
56 | fn type_for_field(def_id: DefId, field: SmolStr) -> Cancelable<Ty> { | 47 | fn type_for_field(def_id: DefId, field: Name) -> Cancelable<Ty> { |
57 | type TypeForFieldQuery; | 48 | type TypeForFieldQuery; |
58 | use fn query_definitions::type_for_field; | 49 | use fn crate::ty::type_for_field; |
59 | } | 50 | } |
60 | 51 | ||
61 | fn file_items(file_id: FileId) -> Arc<SourceFileItems> { | 52 | fn file_items(file_id: FileId) -> Arc<SourceFileItems> { |