diff options
author | csmoe <[email protected]> | 2019-02-01 10:33:41 +0000 |
---|---|---|
committer | csmoe <[email protected]> | 2019-02-01 14:05:24 +0000 |
commit | 4dffdcf14abe0c79f9d7a9702be77958be1f75b1 (patch) | |
tree | 3904cb714292f3e1abe5081e4e516eea1b2568fa /crates/ra_hir/src/query_definitions.rs | |
parent | 12433a78871610edfccc82442846615872747e06 (diff) |
split HirDatabase api
Diffstat (limited to 'crates/ra_hir/src/query_definitions.rs')
-rw-r--r-- | crates/ra_hir/src/query_definitions.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/crates/ra_hir/src/query_definitions.rs b/crates/ra_hir/src/query_definitions.rs index 734a98282..b4d8da1e6 100644 --- a/crates/ra_hir/src/query_definitions.rs +++ b/crates/ra_hir/src/query_definitions.rs | |||
@@ -6,17 +6,20 @@ use ra_syntax::{ | |||
6 | 6 | ||
7 | use crate::{ | 7 | use crate::{ |
8 | SourceFileItems, SourceItemId, HirFileId, | 8 | SourceFileItems, SourceItemId, HirFileId, |
9 | db::HirDatabase, | 9 | PersistentHirDatabase, |
10 | }; | 10 | }; |
11 | 11 | ||
12 | pub(super) fn file_items(db: &impl HirDatabase, file_id: HirFileId) -> Arc<SourceFileItems> { | 12 | pub(super) fn file_items( |
13 | db: &impl PersistentHirDatabase, | ||
14 | file_id: HirFileId, | ||
15 | ) -> Arc<SourceFileItems> { | ||
13 | let source_file = db.hir_parse(file_id); | 16 | let source_file = db.hir_parse(file_id); |
14 | let res = SourceFileItems::new(file_id, &source_file); | 17 | let res = SourceFileItems::new(file_id, &source_file); |
15 | Arc::new(res) | 18 | Arc::new(res) |
16 | } | 19 | } |
17 | 20 | ||
18 | pub(super) fn file_item( | 21 | pub(super) fn file_item( |
19 | db: &impl HirDatabase, | 22 | db: &impl PersistentHirDatabase, |
20 | source_item_id: SourceItemId, | 23 | source_item_id: SourceItemId, |
21 | ) -> TreeArc<SyntaxNode> { | 24 | ) -> TreeArc<SyntaxNode> { |
22 | let source_file = db.hir_parse(source_item_id.file_id); | 25 | let source_file = db.hir_parse(source_item_id.file_id); |