From ccd1b0800a5de5e046e6e9a4b6f49030c1ce3639 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 28 Nov 2019 12:50:26 +0300 Subject: Rename Source -> InFile --- crates/ra_hir_ty/src/diagnostics.rs | 14 +++++++------- crates/ra_hir_ty/src/tests.rs | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'crates/ra_hir_ty') diff --git a/crates/ra_hir_ty/src/diagnostics.rs b/crates/ra_hir_ty/src/diagnostics.rs index 4a13fac23..5054189cc 100644 --- a/crates/ra_hir_ty/src/diagnostics.rs +++ b/crates/ra_hir_ty/src/diagnostics.rs @@ -2,7 +2,7 @@ use std::any::Any; -use hir_expand::{db::AstDatabase, name::Name, HirFileId, Source}; +use hir_expand::{db::AstDatabase, name::Name, HirFileId, InFile}; use ra_syntax::{ast, AstNode, AstPtr, SyntaxNodePtr}; pub use hir_def::diagnostics::UnresolvedModule; @@ -19,8 +19,8 @@ impl Diagnostic for NoSuchField { "no such field".to_string() } - fn source(&self) -> Source { - Source { file_id: self.file, value: self.field.into() } + fn source(&self) -> InFile { + InFile { file_id: self.file, value: self.field.into() } } fn as_any(&self) -> &(dyn Any + Send + 'static) { @@ -44,8 +44,8 @@ impl Diagnostic for MissingFields { } message } - fn source(&self) -> Source { - Source { file_id: self.file, value: self.field_list.into() } + fn source(&self) -> InFile { + InFile { file_id: self.file, value: self.field_list.into() } } fn as_any(&self) -> &(dyn Any + Send + 'static) { self @@ -72,8 +72,8 @@ impl Diagnostic for MissingOkInTailExpr { fn message(&self) -> String { "wrap return expression in Ok".to_string() } - fn source(&self) -> Source { - Source { file_id: self.file, value: self.expr.into() } + fn source(&self) -> InFile { + InFile { file_id: self.file, value: self.expr.into() } } fn as_any(&self) -> &(dyn Any + Send + 'static) { self diff --git a/crates/ra_hir_ty/src/tests.rs b/crates/ra_hir_ty/src/tests.rs index c8461b447..abbc1546c 100644 --- a/crates/ra_hir_ty/src/tests.rs +++ b/crates/ra_hir_ty/src/tests.rs @@ -8,7 +8,7 @@ use hir_def::{ body::BodySourceMap, db::DefDatabase, nameres::CrateDefMap, AssocItemId, DefWithBodyId, LocalModuleId, Lookup, ModuleDefId, }; -use hir_expand::Source; +use hir_expand::InFile; use insta::assert_snapshot; use ra_db::{fixture::WithFixture, salsa::Database, FilePosition, SourceDatabase}; use ra_syntax::{ @@ -4680,7 +4680,7 @@ fn type_at_pos(db: &TestDB, pos: FilePosition) -> String { for decl in crate_def_map[module.local_id].scope.declarations() { if let ModuleDefId::FunctionId(func) = decl { let (_body, source_map) = db.body_with_source_map(func.into()); - if let Some(expr_id) = source_map.node_expr(Source::new(pos.file_id.into(), &expr)) { + if let Some(expr_id) = source_map.node_expr(InFile::new(pos.file_id.into(), &expr)) { let infer = db.infer(func.into()); let ty = &infer[expr_id]; return ty.display(db).to_string(); -- cgit v1.2.3