aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_expand
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-10-30 15:07:12 +0000
committerGitHub <[email protected]>2019-10-30 15:07:12 +0000
commit5806195bc1cdb1ca3fa257e99fd6e0dd897713a9 (patch)
tree92b54891047977e6483e430a467d8e561ea3bc53 /crates/ra_hir_expand
parentf996b6019bd2f388bd9994ea83f25487eb111560 (diff)
parente34e71c62d9b4cf0ab237969e03ecde893ab347b (diff)
Merge #2128
2128: move raw_items to hir_def r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_expand')
-rw-r--r--crates/ra_hir_expand/src/lib.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_hir_expand/src/lib.rs b/crates/ra_hir_expand/src/lib.rs
index 6b3538673..3c0ef8f1c 100644
--- a/crates/ra_hir_expand/src/lib.rs
+++ b/crates/ra_hir_expand/src/lib.rs
@@ -12,7 +12,7 @@ use std::hash::{Hash, Hasher};
12use ra_db::{salsa, CrateId, FileId}; 12use ra_db::{salsa, CrateId, FileId};
13use ra_syntax::ast::{self, AstNode}; 13use ra_syntax::ast::{self, AstNode};
14 14
15use crate::{ast_id_map::FileAstId, db::AstDatabase}; 15use crate::ast_id_map::FileAstId;
16 16
17/// Input to the analyzer is a set of files, where each file is identified by 17/// Input to the analyzer is a set of files, where each file is identified by
18/// `FileId` and contains source code. However, another source of source code in 18/// `FileId` and contains source code. However, another source of source code in
@@ -50,7 +50,7 @@ impl From<MacroFile> for HirFileId {
50impl HirFileId { 50impl HirFileId {
51 /// For macro-expansion files, returns the file original source file the 51 /// For macro-expansion files, returns the file original source file the
52 /// expansion originated from. 52 /// expansion originated from.
53 pub fn original_file(self, db: &dyn AstDatabase) -> FileId { 53 pub fn original_file(self, db: &dyn db::AstDatabase) -> FileId {
54 match self.0 { 54 match self.0 {
55 HirFileIdRepr::FileId(file_id) => file_id, 55 HirFileIdRepr::FileId(file_id) => file_id,
56 HirFileIdRepr::MacroFile(macro_file) => { 56 HirFileIdRepr::MacroFile(macro_file) => {
@@ -61,7 +61,7 @@ impl HirFileId {
61 } 61 }
62 62
63 /// Get the crate which the macro lives in, if it is a macro file. 63 /// Get the crate which the macro lives in, if it is a macro file.
64 pub fn macro_crate(self, db: &dyn AstDatabase) -> Option<CrateId> { 64 pub fn macro_crate(self, db: &dyn db::AstDatabase) -> Option<CrateId> {
65 match self.0 { 65 match self.0 {
66 HirFileIdRepr::FileId(_) => None, 66 HirFileIdRepr::FileId(_) => None,
67 HirFileIdRepr::MacroFile(macro_file) => { 67 HirFileIdRepr::MacroFile(macro_file) => {
@@ -154,7 +154,7 @@ impl<N: AstNode> AstId<N> {
154 self.file_id 154 self.file_id
155 } 155 }
156 156
157 pub fn to_node(&self, db: &dyn AstDatabase) -> N { 157 pub fn to_node(&self, db: &dyn db::AstDatabase) -> N {
158 let root = db.parse_or_expand(self.file_id).unwrap(); 158 let root = db.parse_or_expand(self.file_id).unwrap();
159 db.ast_id_map(self.file_id).get(self.file_ast_id).to_node(&root) 159 db.ast_id_map(self.file_id).get(self.file_ast_id).to_node(&root)
160 } 160 }