diff options
author | Aleksey Kladov <[email protected]> | 2019-01-26 20:25:18 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-26 20:27:01 +0000 |
commit | a128075af9dd7286d444312ca3bbb9645c008f50 (patch) | |
tree | f054e2dcf065c34ecb5c42ea2bd58c520a8d3a21 /crates/ra_hir/src/query_definitions.rs | |
parent | 9c1a18a626770b60e8785aa34505dc2caf061c02 (diff) |
remove Option<SourceFileItemId> hack
Diffstat (limited to 'crates/ra_hir/src/query_definitions.rs')
-rw-r--r-- | crates/ra_hir/src/query_definitions.rs | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/crates/ra_hir/src/query_definitions.rs b/crates/ra_hir/src/query_definitions.rs index 380c06404..bf9ac0dfb 100644 --- a/crates/ra_hir/src/query_definitions.rs +++ b/crates/ra_hir/src/query_definitions.rs | |||
@@ -4,9 +4,7 @@ use std::{ | |||
4 | }; | 4 | }; |
5 | 5 | ||
6 | use rustc_hash::FxHashMap; | 6 | use rustc_hash::FxHashMap; |
7 | use ra_syntax::{ | 7 | use ra_syntax::{SyntaxNode, TreeArc}; |
8 | AstNode, SyntaxNode, TreeArc, | ||
9 | }; | ||
10 | use ra_db::{CrateId}; | 8 | use ra_db::{CrateId}; |
11 | 9 | ||
12 | use crate::{ | 10 | use crate::{ |
@@ -33,12 +31,9 @@ pub(super) fn file_item( | |||
33 | source_item_id: SourceItemId, | 31 | source_item_id: SourceItemId, |
34 | ) -> TreeArc<SyntaxNode> { | 32 | ) -> TreeArc<SyntaxNode> { |
35 | let source_file = db.hir_parse(source_item_id.file_id); | 33 | let source_file = db.hir_parse(source_item_id.file_id); |
36 | match source_item_id.item_id { | 34 | db.file_items(source_item_id.file_id)[source_item_id.item_id] |
37 | Some(id) => db.file_items(source_item_id.file_id)[id] | 35 | .to_node(&source_file) |
38 | .to_node(&source_file) | 36 | .to_owned() |
39 | .to_owned(), | ||
40 | None => source_file.syntax().to_owned(), | ||
41 | } | ||
42 | } | 37 | } |
43 | 38 | ||
44 | pub(super) fn item_map(db: &impl HirDatabase, crate_id: CrateId) -> Arc<ItemMap> { | 39 | pub(super) fn item_map(db: &impl HirDatabase, crate_id: CrateId) -> Arc<ItemMap> { |