aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_expand/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_expand/src/lib.rs')
-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 }