aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/code_model.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-11-28 10:02:46 +0000
committerGitHub <[email protected]>2019-11-28 10:02:46 +0000
commit16030528b53d38e24c1e5733aa4cc46058d0bbd1 (patch)
treee878f88aebf11c0e54eff2e107dfaa4d192ab272 /crates/ra_hir/src/code_model.rs
parent2702fa1c5d6d8ad504c0d7703b6363ea09ba5570 (diff)
parentccd1b0800a5de5e046e6e9a4b6f49030c1ce3639 (diff)
Merge #2440
2440: Rename Source -> InFile r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/code_model.rs')
-rw-r--r--crates/ra_hir/src/code_model.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index 38d66c2a7..dddac915b 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/ra_hir/src/code_model.rs
@@ -30,7 +30,7 @@ use crate::{
30 db::{DefDatabase, HirDatabase}, 30 db::{DefDatabase, HirDatabase},
31 ty::display::HirFormatter, 31 ty::display::HirFormatter,
32 ty::{self, InEnvironment, InferenceResult, TraitEnvironment, Ty, TyDefId, TypeCtor, TypeWalk}, 32 ty::{self, InEnvironment, InferenceResult, TraitEnvironment, Ty, TyDefId, TypeCtor, TypeWalk},
33 CallableDef, Either, HirDisplay, Name, Source, 33 CallableDef, Either, HirDisplay, InFile, Name,
34}; 34};
35 35
36/// hir::Crate describes a single crate. It's the main interface with which 36/// hir::Crate describes a single crate. It's the main interface with which
@@ -118,7 +118,7 @@ impl ModuleSource {
118 } 118 }
119 } 119 }
120 120
121 pub fn from_child_node(db: &impl DefDatabase, child: Source<&SyntaxNode>) -> ModuleSource { 121 pub fn from_child_node(db: &impl DefDatabase, child: InFile<&SyntaxNode>) -> ModuleSource {
122 if let Some(m) = 122 if let Some(m) =
123 child.value.ancestors().filter_map(ast::Module::cast).find(|it| !it.has_semi()) 123 child.value.ancestors().filter_map(ast::Module::cast).find(|it| !it.has_semi())
124 { 124 {
@@ -901,7 +901,7 @@ impl Local {
901 Type { krate, ty: InEnvironment { value: ty, environment } } 901 Type { krate, ty: InEnvironment { value: ty, environment } }
902 } 902 }
903 903
904 pub fn source(self, db: &impl HirDatabase) -> Source<Either<ast::BindPat, ast::SelfParam>> { 904 pub fn source(self, db: &impl HirDatabase) -> InFile<Either<ast::BindPat, ast::SelfParam>> {
905 let (_body, source_map) = db.body_with_source_map(self.parent.into()); 905 let (_body, source_map) = db.body_with_source_map(self.parent.into());
906 let src = source_map.pat_syntax(self.pat_id).unwrap(); // Hmm... 906 let src = source_map.pat_syntax(self.pat_id).unwrap(); // Hmm...
907 let root = src.file_syntax(db); 907 let root = src.file_syntax(db);