From 9e213385c9d06db3c8ca20812779e2b8f8ad2c71 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 30 Mar 2019 13:25:53 +0300 Subject: switch to new rowan --- crates/ra_hir/src/ty/tests.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'crates/ra_hir/src/ty') diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 655f3c522..943c5499b 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs @@ -2251,14 +2251,12 @@ fn infer(content: &str) -> String { types.sort_by_key(|(ptr, _)| (ptr.range().start(), ptr.range().end())); for (syntax_ptr, ty) in &types { let node = syntax_ptr.to_node(&source_file); - write!( - acc, - "{} '{}': {}\n", - syntax_ptr.range(), - ellipsize(node.text().to_string().replace("\n", " "), 15), - ty.display(&db) - ) - .unwrap(); + let (range, text) = if let Some(self_param) = ast::SelfParam::cast(node) { + (self_param.self_kw_token().range(), "self".to_string()) + } else { + (syntax_ptr.range(), node.text().to_string().replace("\n", " ")) + }; + write!(acc, "{} '{}': {}\n", range, ellipsize(text, 15), ty.display(&db)).unwrap(); } } acc.truncate(acc.trim_end().len()); -- cgit v1.2.3