aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-11-20 06:44:37 +0000
committerGitHub <[email protected]>2019-11-20 06:44:37 +0000
commit4dae39a609fb58b42cbe152e66d30fe6471a34d7 (patch)
tree166ee3c45f99611f7c20740c2a246f5b3bed41a3 /crates/ra_hir/src/ty
parenteec68e6f451ee7675ce2cb29b696df091e6aed13 (diff)
parent36e3fc9d5413f7e6e17e82867aae1318645880a3 (diff)
Merge #2319
2319: Rename Source::ast -> Source::value r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r--crates/ra_hir/src/ty/tests.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs
index ca1693679..c1024d03c 100644
--- a/crates/ra_hir/src/ty/tests.rs
+++ b/crates/ra_hir/src/ty/tests.rs
@@ -4694,14 +4694,16 @@ fn infer(content: &str) -> String {
4694 } 4694 }
4695 4695
4696 // sort ranges for consistency 4696 // sort ranges for consistency
4697 types.sort_by_key(|(src_ptr, _)| (src_ptr.ast.range().start(), src_ptr.ast.range().end())); 4697 types.sort_by_key(|(src_ptr, _)| {
4698 (src_ptr.value.range().start(), src_ptr.value.range().end())
4699 });
4698 for (src_ptr, ty) in &types { 4700 for (src_ptr, ty) in &types {
4699 let node = src_ptr.ast.to_node(&src_ptr.file_syntax(&db)); 4701 let node = src_ptr.value.to_node(&src_ptr.file_syntax(&db));
4700 4702
4701 let (range, text) = if let Some(self_param) = ast::SelfParam::cast(node.clone()) { 4703 let (range, text) = if let Some(self_param) = ast::SelfParam::cast(node.clone()) {
4702 (self_param.self_kw_token().text_range(), "self".to_string()) 4704 (self_param.self_kw_token().text_range(), "self".to_string())
4703 } else { 4705 } else {
4704 (src_ptr.ast.range(), node.text().to_string().replace("\n", " ")) 4706 (src_ptr.value.range(), node.text().to_string().replace("\n", " "))
4705 }; 4707 };
4706 let macro_prefix = if src_ptr.file_id != file_id.into() { "!" } else { "" }; 4708 let macro_prefix = if src_ptr.file_id != file_id.into() { "!" } else { "" };
4707 write!( 4709 write!(