diff options
author | Florian Diebold <[email protected]> | 2019-01-19 18:57:43 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-01-30 20:39:34 +0000 |
commit | 1acff307fe2e20f0c2291fd24b08fba6fa39e5ee (patch) | |
tree | 18046068a9d7bb72747bbabfc22d1121fea1604a /crates/ra_hir/src/query_definitions.rs | |
parent | 65864d85f992300bad3913438a542af1bd736a24 (diff) |
Move expr_scopes query to its module
Diffstat (limited to 'crates/ra_hir/src/query_definitions.rs')
-rw-r--r-- | crates/ra_hir/src/query_definitions.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/crates/ra_hir/src/query_definitions.rs b/crates/ra_hir/src/query_definitions.rs index 1b61d449e..734a98282 100644 --- a/crates/ra_hir/src/query_definitions.rs +++ b/crates/ra_hir/src/query_definitions.rs | |||
@@ -1,19 +1,14 @@ | |||
1 | use std::sync::Arc; | 1 | use std::sync::Arc; |
2 | 2 | ||
3 | use ra_syntax::{SyntaxNode, TreeArc}; | 3 | use ra_syntax::{ |
4 | SyntaxNode, TreeArc, | ||
5 | }; | ||
4 | 6 | ||
5 | use crate::{ | 7 | use crate::{ |
6 | SourceFileItems, SourceItemId, HirFileId, | 8 | SourceFileItems, SourceItemId, HirFileId, |
7 | Function, ExprScopes, | ||
8 | db::HirDatabase, | 9 | db::HirDatabase, |
9 | }; | 10 | }; |
10 | 11 | ||
11 | pub(super) fn expr_scopes(db: &impl HirDatabase, func: Function) -> Arc<ExprScopes> { | ||
12 | let body = db.body_hir(func); | ||
13 | let res = ExprScopes::new(body); | ||
14 | Arc::new(res) | ||
15 | } | ||
16 | |||
17 | pub(super) fn file_items(db: &impl HirDatabase, file_id: HirFileId) -> Arc<SourceFileItems> { | 12 | pub(super) fn file_items(db: &impl HirDatabase, file_id: HirFileId) -> Arc<SourceFileItems> { |
18 | let source_file = db.hir_parse(file_id); | 13 | let source_file = db.hir_parse(file_id); |
19 | let res = SourceFileItems::new(file_id, &source_file); | 14 | let res = SourceFileItems::new(file_id, &source_file); |