From 6d5d82e412dea19ea48eecc6f7d5a4aa223a9599 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 20 Jul 2019 12:48:24 +0300 Subject: move debug_dump to fmt::Debug --- crates/ra_hir/src/expr.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs index 66cb9633b..6eed67f50 100644 --- a/crates/ra_hir/src/expr.rs +++ b/crates/ra_hir/src/expr.rs @@ -843,7 +843,7 @@ where let file_id = call_id.as_file(MacroFileKind::Expr); if let Some(node) = self.db.parse_or_expand(file_id) { if let Some(expr) = ast::Expr::cast(node) { - log::debug!("macro expansion {}", expr.syntax().debug_dump()); + log::debug!("macro expansion {:#?}", expr.syntax()); let old_file_id = std::mem::replace(&mut self.current_file_id, file_id); let id = self.collect_expr(expr); -- cgit v1.2.3 From f3bdbec1b68fa0e20f0b7b6c6ef64e1507970b0d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 20 Jul 2019 12:58:27 +0300 Subject: rename range -> text_range --- crates/ra_hir/src/expr/scope.rs | 2 +- crates/ra_hir/src/source_binder.rs | 2 +- crates/ra_hir/src/ty/tests.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/expr/scope.rs b/crates/ra_hir/src/expr/scope.rs index 6589b782c..79e1857f9 100644 --- a/crates/ra_hir/src/expr/scope.rs +++ b/crates/ra_hir/src/expr/scope.rs @@ -296,7 +296,7 @@ mod tests { let local_name_entry = analyzer.resolve_local_name(&name_ref).unwrap(); let local_name = local_name_entry.ptr().either(|it| it.syntax_node_ptr(), |it| it.syntax_node_ptr()); - assert_eq!(local_name.range(), expected_name.syntax().range()); + assert_eq!(local_name.range(), expected_name.syntax().text_range()); } #[test] diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs index df67d2c39..4c173a4f7 100644 --- a/crates/ra_hir/src/source_binder.rs +++ b/crates/ra_hir/src/source_binder.rs @@ -361,7 +361,7 @@ impl SourceAnalyzer { }) .map(|name_ref| ReferenceDescriptor { name: name_ref.text().to_string(), - range: name_ref.syntax().range(), + range: name_ref.syntax().text_range(), }) .collect() } diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 265740e54..7b2bdeb3f 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs @@ -3127,7 +3127,7 @@ fn infer(content: &str) -> String { for (syntax_ptr, ty) in &types { let node = syntax_ptr.to_node(source_file.syntax()); let (range, text) = if let Some(self_param) = ast::SelfParam::cast(node.clone()) { - (self_param.self_kw_token().range(), "self".to_string()) + (self_param.self_kw_token().text_range(), "self".to_string()) } else { (syntax_ptr.range(), node.text().to_string().replace("\n", " ")) }; -- cgit v1.2.3