aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide')
-rw-r--r--crates/ra_ide/src/call_hierarchy.rs37
1 files changed, 37 insertions, 0 deletions
diff --git a/crates/ra_ide/src/call_hierarchy.rs b/crates/ra_ide/src/call_hierarchy.rs
index 1e3a31602..bd0e48834 100644
--- a/crates/ra_ide/src/call_hierarchy.rs
+++ b/crates/ra_ide/src/call_hierarchy.rs
@@ -355,4 +355,41 @@ fn caller3() {
355 &["caller3 FN_DEF FileId(1) 66..83 69..76 : [52..59]"], 355 &["caller3 FN_DEF FileId(1) 66..83 69..76 : [52..59]"],
356 ); 356 );
357 } 357 }
358
359 #[test]
360 fn test_call_hierarchy_issue_5103() {
361 check_hierarchy(
362 r#"
363fn a() {
364 b()
365}
366
367fn b() {}
368
369fn main() {
370 a<|>()
371}
372"#,
373 "a FN_DEF FileId(1) 0..18 3..4",
374 &["main FN_DEF FileId(1) 31..52 34..38 : [47..48]"],
375 &["b FN_DEF FileId(1) 20..29 23..24 : [13..14]"],
376 );
377
378 check_hierarchy(
379 r#"
380fn a() {
381 b<|>()
382}
383
384fn b() {}
385
386fn main() {
387 a()
388}
389"#,
390 "b FN_DEF FileId(1) 20..29 23..24",
391 &["a FN_DEF FileId(1) 0..18 3..4 : [13..14]"],
392 &[],
393 );
394 }
358} 395}