aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-20 10:59:10 +0100
committerbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-20 10:59:10 +0100
commit6b352ffeb346eb7c7e46e00e790c2f395907eaa6 (patch)
treef19271365126259a7975dda9ee3e1e1496a299dd /crates/ra_hir
parent2830d1376b05794c7bf1467fe52ad3bc0eb4ca41 (diff)
parentf3bdbec1b68fa0e20f0b7b6c6ef64e1507970b0d (diff)
Merge #1560
1560: move debug_dump to fmt::Debug r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/expr.rs2
-rw-r--r--crates/ra_hir/src/expr/scope.rs2
-rw-r--r--crates/ra_hir/src/source_binder.rs2
-rw-r--r--crates/ra_hir/src/ty/tests.rs2
4 files changed, 4 insertions, 4 deletions
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
843 let file_id = call_id.as_file(MacroFileKind::Expr); 843 let file_id = call_id.as_file(MacroFileKind::Expr);
844 if let Some(node) = self.db.parse_or_expand(file_id) { 844 if let Some(node) = self.db.parse_or_expand(file_id) {
845 if let Some(expr) = ast::Expr::cast(node) { 845 if let Some(expr) = ast::Expr::cast(node) {
846 log::debug!("macro expansion {}", expr.syntax().debug_dump()); 846 log::debug!("macro expansion {:#?}", expr.syntax());
847 let old_file_id = 847 let old_file_id =
848 std::mem::replace(&mut self.current_file_id, file_id); 848 std::mem::replace(&mut self.current_file_id, file_id);
849 let id = self.collect_expr(expr); 849 let id = self.collect_expr(expr);
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 {
296 let local_name_entry = analyzer.resolve_local_name(&name_ref).unwrap(); 296 let local_name_entry = analyzer.resolve_local_name(&name_ref).unwrap();
297 let local_name = 297 let local_name =
298 local_name_entry.ptr().either(|it| it.syntax_node_ptr(), |it| it.syntax_node_ptr()); 298 local_name_entry.ptr().either(|it| it.syntax_node_ptr(), |it| it.syntax_node_ptr());
299 assert_eq!(local_name.range(), expected_name.syntax().range()); 299 assert_eq!(local_name.range(), expected_name.syntax().text_range());
300 } 300 }
301 301
302 #[test] 302 #[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 {
361 }) 361 })
362 .map(|name_ref| ReferenceDescriptor { 362 .map(|name_ref| ReferenceDescriptor {
363 name: name_ref.text().to_string(), 363 name: name_ref.text().to_string(),
364 range: name_ref.syntax().range(), 364 range: name_ref.syntax().text_range(),
365 }) 365 })
366 .collect() 366 .collect()
367 } 367 }
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 {
3127 for (syntax_ptr, ty) in &types { 3127 for (syntax_ptr, ty) in &types {
3128 let node = syntax_ptr.to_node(source_file.syntax()); 3128 let node = syntax_ptr.to_node(source_file.syntax());
3129 let (range, text) = if let Some(self_param) = ast::SelfParam::cast(node.clone()) { 3129 let (range, text) = if let Some(self_param) = ast::SelfParam::cast(node.clone()) {
3130 (self_param.self_kw_token().range(), "self".to_string()) 3130 (self_param.self_kw_token().text_range(), "self".to_string())
3131 } else { 3131 } else {
3132 (syntax_ptr.range(), node.text().to_string().replace("\n", " ")) 3132 (syntax_ptr.range(), node.text().to_string().replace("\n", " "))
3133 }; 3133 };