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/src') 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