diff options
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 6724649e1..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, FnScopes, | ||
8 | db::HirDatabase, | 9 | db::HirDatabase, |
9 | }; | 10 | }; |
10 | 11 | ||
11 | pub(super) fn fn_scopes(db: &impl HirDatabase, func: Function) -> Arc<FnScopes> { | ||
12 | let body = db.body_hir(func); | ||
13 | let res = FnScopes::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); |