diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-01 10:30:25 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-01 10:30:25 +0100 |
commit | 42a883f06c28ddeab22e5703a578f19110dde7f3 (patch) | |
tree | fe57697b54ccfb791fe96c13cb553a8570516270 /crates/ra_hir/src/ty | |
parent | dec9bde10868b5e459535449476d17a6a0987b3e (diff) | |
parent | 9e213385c9d06db3c8ca20812779e2b8f8ad2c71 (diff) |
Merge #1078
1078: rewrite syntax trees 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.rs | 14 |
1 files changed, 6 insertions, 8 deletions
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 { | |||
2251 | types.sort_by_key(|(ptr, _)| (ptr.range().start(), ptr.range().end())); | 2251 | types.sort_by_key(|(ptr, _)| (ptr.range().start(), ptr.range().end())); |
2252 | for (syntax_ptr, ty) in &types { | 2252 | for (syntax_ptr, ty) in &types { |
2253 | let node = syntax_ptr.to_node(&source_file); | 2253 | let node = syntax_ptr.to_node(&source_file); |
2254 | write!( | 2254 | let (range, text) = if let Some(self_param) = ast::SelfParam::cast(node) { |
2255 | acc, | 2255 | (self_param.self_kw_token().range(), "self".to_string()) |
2256 | "{} '{}': {}\n", | 2256 | } else { |
2257 | syntax_ptr.range(), | 2257 | (syntax_ptr.range(), node.text().to_string().replace("\n", " ")) |
2258 | ellipsize(node.text().to_string().replace("\n", " "), 15), | 2258 | }; |
2259 | ty.display(&db) | 2259 | write!(acc, "{} '{}': {}\n", range, ellipsize(text, 15), ty.display(&db)).unwrap(); |
2260 | ) | ||
2261 | .unwrap(); | ||
2262 | } | 2260 | } |
2263 | } | 2261 | } |
2264 | acc.truncate(acc.trim_end().len()); | 2262 | acc.truncate(acc.trim_end().len()); |