aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/hover.rs
diff options
context:
space:
mode:
authorKevaundray Wedderburn <[email protected]>2021-01-06 20:15:48 +0000
committerKevaundray Wedderburn <[email protected]>2021-01-07 12:09:23 +0000
commit72b9a4fbd3c12f3250b9157a1d44230e04ec8b22 (patch)
treec138363e3592c690d841aeedb9ac97d6b2ff4396 /crates/ide/src/hover.rs
parent171c3c08fe245938fb25321394233de5fe2abc7c (diff)
Change <|> to $0 - Rebase
Diffstat (limited to 'crates/ide/src/hover.rs')
-rw-r--r--crates/ide/src/hover.rs216
1 files changed, 108 insertions, 108 deletions
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs
index a12a2475e..8cb4a51d8 100644
--- a/crates/ide/src/hover.rs
+++ b/crates/ide/src/hover.rs
@@ -457,7 +457,7 @@ mod tests {
457pub fn foo() -> u32 { 1 } 457pub fn foo() -> u32 { 1 }
458 458
459fn main() { 459fn main() {
460 let foo_test = foo()<|>; 460 let foo_test = foo()$0;
461} 461}
462"#, 462"#,
463 expect![[r#" 463 expect![[r#"
@@ -476,7 +476,7 @@ fn main() {
476pub fn foo() -> u32 { 1 } 476pub fn foo() -> u32 { 1 }
477 477
478fn main() { 478fn main() {
479 let foo_test = foo()<|>; 479 let foo_test = foo()$0;
480} 480}
481"#, 481"#,
482 expect![[r#" 482 expect![[r#"
@@ -506,7 +506,7 @@ fn main() {
506 Option::Some(*memo + value) 506 Option::Some(*memo + value)
507 }; 507 };
508 let number = 5u32; 508 let number = 5u32;
509 let mut iter<|> = scan(OtherStruct { i: num }, closure, number); 509 let mut iter$0 = scan(OtherStruct { i: num }, closure, number);
510} 510}
511"#, 511"#,
512 expect![[r#" 512 expect![[r#"
@@ -526,7 +526,7 @@ fn main() {
526 r#" 526 r#"
527pub fn foo() -> u32 { 1 } 527pub fn foo() -> u32 { 1 }
528 528
529fn main() { let foo_test = fo<|>o(); } 529fn main() { let foo_test = fo$0o(); }
530"#, 530"#,
531 expect![[r#" 531 expect![[r#"
532 *foo* 532 *foo*
@@ -558,7 +558,7 @@ mod a;
558mod b; 558mod b;
559mod c; 559mod c;
560 560
561fn main() { let foo_test = fo<|>o(); } 561fn main() { let foo_test = fo$0o(); }
562 "#, 562 "#,
563 expect![[r#" 563 expect![[r#"
564 *foo* 564 *foo*
@@ -575,7 +575,7 @@ fn main() { let foo_test = fo<|>o(); }
575 r#" 575 r#"
576pub fn foo<'a, T: AsRef<str>>(b: &'a T) -> &'a str { } 576pub fn foo<'a, T: AsRef<str>>(b: &'a T) -> &'a str { }
577 577
578fn main() { let foo_test = fo<|>o(); } 578fn main() { let foo_test = fo$0o(); }
579 "#, 579 "#,
580 expect![[r#" 580 expect![[r#"
581 *foo* 581 *foo*
@@ -595,7 +595,7 @@ fn main() { let foo_test = fo<|>o(); }
595 fn hover_shows_fn_signature_on_fn_name() { 595 fn hover_shows_fn_signature_on_fn_name() {
596 check( 596 check(
597 r#" 597 r#"
598pub fn foo<|>(a: u32, b: u32) -> u32 {} 598pub fn foo$0(a: u32, b: u32) -> u32 {}
599 599
600fn main() { } 600fn main() { }
601"#, 601"#,
@@ -623,7 +623,7 @@ fn main() { }
623/// # 623/// #
624/// foo(Path::new("hello, world!")) 624/// foo(Path::new("hello, world!"))
625/// ``` 625/// ```
626pub fn foo<|>(_: &Path) {} 626pub fn foo$0(_: &Path) {}
627 627
628fn main() { } 628fn main() { }
629"#, 629"#,
@@ -656,7 +656,7 @@ fn main() { }
656 check( 656 check(
657 r##" 657 r##"
658#[doc = r#"Raw string doc attr"#] 658#[doc = r#"Raw string doc attr"#]
659pub fn foo<|>(_: &Path) {} 659pub fn foo$0(_: &Path) {}
660 660
661fn main() { } 661fn main() { }
662"##, 662"##,
@@ -686,7 +686,7 @@ fn main() { }
686struct Foo { field_a: u32 } 686struct Foo { field_a: u32 }
687 687
688fn main() { 688fn main() {
689 let foo = Foo { field_a<|>: 0, }; 689 let foo = Foo { field_a$0: 0, };
690} 690}
691"#, 691"#,
692 expect![[r#" 692 expect![[r#"
@@ -705,7 +705,7 @@ fn main() {
705 // Hovering over the field in the definition 705 // Hovering over the field in the definition
706 check( 706 check(
707 r#" 707 r#"
708struct Foo { field_a<|>: u32 } 708struct Foo { field_a$0: u32 }
709 709
710fn main() { 710fn main() {
711 let foo = Foo { field_a: 0 }; 711 let foo = Foo { field_a: 0 };
@@ -728,7 +728,7 @@ fn main() {
728 #[test] 728 #[test]
729 fn hover_const_static() { 729 fn hover_const_static() {
730 check( 730 check(
731 r#"const foo<|>: u32 = 123;"#, 731 r#"const foo$0: u32 = 123;"#,
732 expect![[r#" 732 expect![[r#"
733 *foo* 733 *foo*
734 734
@@ -742,7 +742,7 @@ fn main() {
742 "#]], 742 "#]],
743 ); 743 );
744 check( 744 check(
745 r#"static foo<|>: u32 = 456;"#, 745 r#"static foo$0: u32 = 456;"#,
746 expect![[r#" 746 expect![[r#"
747 *foo* 747 *foo*
748 748
@@ -764,7 +764,7 @@ fn main() {
764struct Test<K, T = u8> { k: K, t: T } 764struct Test<K, T = u8> { k: K, t: T }
765 765
766fn main() { 766fn main() {
767 let zz<|> = Test { t: 23u8, k: 33 }; 767 let zz$0 = Test { t: 23u8, k: 33 };
768}"#, 768}"#,
769 expect![[r#" 769 expect![[r#"
770 *zz* 770 *zz*
@@ -783,7 +783,7 @@ fn main() {
783enum Option<T> { Some(T) } 783enum Option<T> { Some(T) }
784use Option::Some; 784use Option::Some;
785 785
786fn main() { So<|>me(12); } 786fn main() { So$0me(12); }
787"#, 787"#,
788 expect![[r#" 788 expect![[r#"
789 *Some* 789 *Some*
@@ -803,7 +803,7 @@ fn main() { So<|>me(12); }
803enum Option<T> { Some(T) } 803enum Option<T> { Some(T) }
804use Option::Some; 804use Option::Some;
805 805
806fn main() { let b<|>ar = Some(12); } 806fn main() { let b$0ar = Some(12); }
807"#, 807"#,
808 expect![[r#" 808 expect![[r#"
809 *bar* 809 *bar*
@@ -821,7 +821,7 @@ fn main() { let b<|>ar = Some(12); }
821 r#" 821 r#"
822enum Option<T> { 822enum Option<T> {
823 /// The None variant 823 /// The None variant
824 Non<|>e 824 Non$0e
825} 825}
826"#, 826"#,
827 expect![[r#" 827 expect![[r#"
@@ -848,7 +848,7 @@ enum Option<T> {
848 Some(T) 848 Some(T)
849} 849}
850fn main() { 850fn main() {
851 let s = Option::Som<|>e(12); 851 let s = Option::Som$0e(12);
852} 852}
853"#, 853"#,
854 expect![[r#" 854 expect![[r#"
@@ -872,7 +872,7 @@ fn main() {
872 #[test] 872 #[test]
873 fn hover_for_local_variable() { 873 fn hover_for_local_variable() {
874 check( 874 check(
875 r#"fn func(foo: i32) { fo<|>o; }"#, 875 r#"fn func(foo: i32) { fo$0o; }"#,
876 expect![[r#" 876 expect![[r#"
877 *foo* 877 *foo*
878 878
@@ -886,7 +886,7 @@ fn main() {
886 #[test] 886 #[test]
887 fn hover_for_local_variable_pat() { 887 fn hover_for_local_variable_pat() {
888 check( 888 check(
889 r#"fn func(fo<|>o: i32) {}"#, 889 r#"fn func(fo$0o: i32) {}"#,
890 expect![[r#" 890 expect![[r#"
891 *foo* 891 *foo*
892 892
@@ -900,7 +900,7 @@ fn main() {
900 #[test] 900 #[test]
901 fn hover_local_var_edge() { 901 fn hover_local_var_edge() {
902 check( 902 check(
903 r#"fn func(foo: i32) { if true { <|>foo; }; }"#, 903 r#"fn func(foo: i32) { if true { $0foo; }; }"#,
904 expect![[r#" 904 expect![[r#"
905 *foo* 905 *foo*
906 906
@@ -914,7 +914,7 @@ fn main() {
914 #[test] 914 #[test]
915 fn hover_for_param_edge() { 915 fn hover_for_param_edge() {
916 check( 916 check(
917 r#"fn func(<|>foo: i32) {}"#, 917 r#"fn func($0foo: i32) {}"#,
918 expect![[r#" 918 expect![[r#"
919 *foo* 919 *foo*
920 920
@@ -934,7 +934,7 @@ fn main() {
934 trait DerefMut { 934 trait DerefMut {
935 type Target: ?Sized; 935 type Target: ?Sized;
936 } 936 }
937 fn f(_x<|>: impl Deref<Target=u8> + DerefMut<Target=u8>) {}"#, 937 fn f(_x$0: impl Deref<Target=u8> + DerefMut<Target=u8>) {}"#,
938 expect![[r#" 938 expect![[r#"
939 *_x* 939 *_x*
940 940
@@ -955,7 +955,7 @@ impl Thing {
955 fn new() -> Thing { Thing { x: 0 } } 955 fn new() -> Thing { Thing { x: 0 } }
956} 956}
957 957
958fn main() { let foo_<|>test = Thing::new(); } 958fn main() { let foo_$0test = Thing::new(); }
959 "#, 959 "#,
960 expect![[r#" 960 expect![[r#"
961 *foo_test* 961 *foo_test*
@@ -979,7 +979,7 @@ mod wrapper {
979 } 979 }
980} 980}
981 981
982fn main() { let foo_test = wrapper::Thing::new<|>(); } 982fn main() { let foo_test = wrapper::Thing::new$0(); }
983"#, 983"#,
984 expect![[r#" 984 expect![[r#"
985 *new* 985 *new*
@@ -1006,7 +1006,7 @@ impl X {
1006 1006
1007fn main() { 1007fn main() {
1008 match 1 { 1008 match 1 {
1009 X::C<|> => {}, 1009 X::C$0 => {},
1010 2 => {}, 1010 2 => {},
1011 _ => {} 1011 _ => {}
1012 }; 1012 };
@@ -1032,7 +1032,7 @@ fn main() {
1032 r#" 1032 r#"
1033struct Thing { x: u32 } 1033struct Thing { x: u32 }
1034impl Thing { 1034impl Thing {
1035 fn new() -> Self { Self<|> { x: 0 } } 1035 fn new() -> Self { Self$0 { x: 0 } }
1036} 1036}
1037"#, 1037"#,
1038 expect![[r#" 1038 expect![[r#"
@@ -1051,7 +1051,7 @@ impl Thing {
1051 r#" 1051 r#"
1052struct Thing { x: u32 } 1052struct Thing { x: u32 }
1053impl Thing { 1053impl Thing {
1054 fn new() -> Self<|> { Self { x: 0 } } 1054 fn new() -> Self$0 { Self { x: 0 } }
1055} 1055}
1056"#, 1056"#,
1057 expect![[r#" 1057 expect![[r#"
@@ -1070,7 +1070,7 @@ impl Thing {
1070 r#" 1070 r#"
1071enum Thing { A } 1071enum Thing { A }
1072impl Thing { 1072impl Thing {
1073 pub fn new() -> Self<|> { Thing::A } 1073 pub fn new() -> Self$0 { Thing::A }
1074} 1074}
1075"#, 1075"#,
1076 expect![[r#" 1076 expect![[r#"
@@ -1089,7 +1089,7 @@ impl Thing {
1089 r#" 1089 r#"
1090 enum Thing { A } 1090 enum Thing { A }
1091 impl Thing { 1091 impl Thing {
1092 pub fn thing(a: Self<|>) {} 1092 pub fn thing(a: Self$0) {}
1093 } 1093 }
1094 "#, 1094 "#,
1095 expect![[r#" 1095 expect![[r#"
@@ -1114,7 +1114,7 @@ fn x() {}
1114 1114
1115fn y() { 1115fn y() {
1116 let x = 0i32; 1116 let x = 0i32;
1117 x<|>; 1117 x$0;
1118} 1118}
1119"#, 1119"#,
1120 expect![[r#" 1120 expect![[r#"
@@ -1133,7 +1133,7 @@ fn y() {
1133 r#" 1133 r#"
1134macro_rules! foo { () => {} } 1134macro_rules! foo { () => {} }
1135 1135
1136fn f() { fo<|>o!(); } 1136fn f() { fo$0o!(); }
1137"#, 1137"#,
1138 expect![[r#" 1138 expect![[r#"
1139 *foo* 1139 *foo*
@@ -1152,7 +1152,7 @@ fn f() { fo<|>o!(); }
1152 #[test] 1152 #[test]
1153 fn test_hover_tuple_field() { 1153 fn test_hover_tuple_field() {
1154 check( 1154 check(
1155 r#"struct TS(String, i32<|>);"#, 1155 r#"struct TS(String, i32$0);"#,
1156 expect![[r#" 1156 expect![[r#"
1157 *i32* 1157 *i32*
1158 1158
@@ -1170,7 +1170,7 @@ fn f() { fo<|>o!(); }
1170macro_rules! id { ($($tt:tt)*) => { $($tt)* } } 1170macro_rules! id { ($($tt:tt)*) => { $($tt)* } }
1171fn foo() {} 1171fn foo() {}
1172id! { 1172id! {
1173 fn bar() { fo<|>o(); } 1173 fn bar() { fo$0o(); }
1174} 1174}
1175"#, 1175"#,
1176 expect![[r#" 1176 expect![[r#"
@@ -1192,7 +1192,7 @@ id! {
1192 check( 1192 check(
1193 r#" 1193 r#"
1194macro_rules! id { ($($tt:tt)*) => { $($tt)* } } 1194macro_rules! id { ($($tt:tt)*) => { $($tt)* } }
1195fn foo(bar:u32) { let a = id!(ba<|>r); } 1195fn foo(bar:u32) { let a = id!(ba$0r); }
1196"#, 1196"#,
1197 expect![[r#" 1197 expect![[r#"
1198 *bar* 1198 *bar*
@@ -1210,7 +1210,7 @@ fn foo(bar:u32) { let a = id!(ba<|>r); }
1210 r#" 1210 r#"
1211macro_rules! id_deep { ($($tt:tt)*) => { $($tt)* } } 1211macro_rules! id_deep { ($($tt:tt)*) => { $($tt)* } }
1212macro_rules! id { ($($tt:tt)*) => { id_deep!($($tt)*) } } 1212macro_rules! id { ($($tt:tt)*) => { id_deep!($($tt)*) } }
1213fn foo(bar:u32) { let a = id!(ba<|>r); } 1213fn foo(bar:u32) { let a = id!(ba$0r); }
1214"#, 1214"#,
1215 expect![[r#" 1215 expect![[r#"
1216 *bar* 1216 *bar*
@@ -1229,7 +1229,7 @@ fn foo(bar:u32) { let a = id!(ba<|>r); }
1229macro_rules! id_deep { ($($tt:tt)*) => { $($tt)* } } 1229macro_rules! id_deep { ($($tt:tt)*) => { $($tt)* } }
1230macro_rules! id { ($($tt:tt)*) => { id_deep!($($tt)*) } } 1230macro_rules! id { ($($tt:tt)*) => { id_deep!($($tt)*) } }
1231fn bar() -> u32 { 0 } 1231fn bar() -> u32 { 0 }
1232fn foo() { let a = id!([0u32, bar(<|>)] ); } 1232fn foo() { let a = id!([0u32, bar($0)] ); }
1233"#, 1233"#,
1234 expect![[r#" 1234 expect![[r#"
1235 *bar()* 1235 *bar()*
@@ -1247,7 +1247,7 @@ fn foo() { let a = id!([0u32, bar(<|>)] ); }
1247macro_rules! arr { ($($tt:tt)*) => { [$($tt)*)] } } 1247macro_rules! arr { ($($tt:tt)*) => { [$($tt)*)] } }
1248fn foo() { 1248fn foo() {
1249 let mastered_for_itunes = ""; 1249 let mastered_for_itunes = "";
1250 let _ = arr!("Tr<|>acks", &mastered_for_itunes); 1250 let _ = arr!("Tr$0acks", &mastered_for_itunes);
1251} 1251}
1252"#, 1252"#,
1253 expect![[r#" 1253 expect![[r#"
@@ -1268,7 +1268,7 @@ macro_rules! assert {}
1268 1268
1269fn bar() -> bool { true } 1269fn bar() -> bool { true }
1270fn foo() { 1270fn foo() {
1271 assert!(ba<|>r()); 1271 assert!(ba$0r());
1272} 1272}
1273"#, 1273"#,
1274 expect![[r#" 1274 expect![[r#"
@@ -1293,7 +1293,7 @@ fn foo() {
1293 macro_rules! format {} 1293 macro_rules! format {}
1294 1294
1295 fn foo() { 1295 fn foo() {
1296 format!("hel<|>lo {}", 0); 1296 format!("hel$0lo {}", 0);
1297 } 1297 }
1298 "#, 1298 "#,
1299 ); 1299 );
@@ -1306,7 +1306,7 @@ fn foo() {
1306/// <- `\u{3000}` here 1306/// <- `\u{3000}` here
1307fn foo() { } 1307fn foo() { }
1308 1308
1309fn bar() { fo<|>o(); } 1309fn bar() { fo$0o(); }
1310", 1310",
1311 expect![[r#" 1311 expect![[r#"
1312 *foo* 1312 *foo*
@@ -1329,7 +1329,7 @@ fn bar() { fo<|>o(); }
1329 #[test] 1329 #[test]
1330 fn test_hover_function_show_qualifiers() { 1330 fn test_hover_function_show_qualifiers() {
1331 check( 1331 check(
1332 r#"async fn foo<|>() {}"#, 1332 r#"async fn foo$0() {}"#,
1333 expect![[r#" 1333 expect![[r#"
1334 *foo* 1334 *foo*
1335 1335
@@ -1343,7 +1343,7 @@ fn bar() { fo<|>o(); }
1343 "#]], 1343 "#]],
1344 ); 1344 );
1345 check( 1345 check(
1346 r#"pub const unsafe fn foo<|>() {}"#, 1346 r#"pub const unsafe fn foo$0() {}"#,
1347 expect![[r#" 1347 expect![[r#"
1348 *foo* 1348 *foo*
1349 1349
@@ -1357,7 +1357,7 @@ fn bar() { fo<|>o(); }
1357 "#]], 1357 "#]],
1358 ); 1358 );
1359 check( 1359 check(
1360 r#"pub(crate) async unsafe extern "C" fn foo<|>() {}"#, 1360 r#"pub(crate) async unsafe extern "C" fn foo$0() {}"#,
1361 expect![[r#" 1361 expect![[r#"
1362 *foo* 1362 *foo*
1363 1363
@@ -1375,7 +1375,7 @@ fn bar() { fo<|>o(); }
1375 #[test] 1375 #[test]
1376 fn test_hover_trait_show_qualifiers() { 1376 fn test_hover_trait_show_qualifiers() {
1377 check_actions( 1377 check_actions(
1378 r"unsafe trait foo<|>() {}", 1378 r"unsafe trait foo$0() {}",
1379 expect![[r#" 1379 expect![[r#"
1380 [ 1380 [
1381 Implementation( 1381 Implementation(
@@ -1396,7 +1396,7 @@ fn bar() { fo<|>o(); }
1396 check( 1396 check(
1397 r#" 1397 r#"
1398//- /main.rs crate:main deps:std 1398//- /main.rs crate:main deps:std
1399extern crate st<|>d; 1399extern crate st$0d;
1400//- /std/lib.rs crate:std 1400//- /std/lib.rs crate:std
1401//! Standard library for this test 1401//! Standard library for this test
1402//! 1402//!
@@ -1414,7 +1414,7 @@ extern crate st<|>d;
1414 check( 1414 check(
1415 r#" 1415 r#"
1416//- /main.rs crate:main deps:std 1416//- /main.rs crate:main deps:std
1417extern crate std as ab<|>c; 1417extern crate std as ab$0c;
1418//- /std/lib.rs crate:std 1418//- /std/lib.rs crate:std
1419//! Standard library for this test 1419//! Standard library for this test
1420//! 1420//!
@@ -1435,7 +1435,7 @@ extern crate std as ab<|>c;
1435 fn test_hover_mod_with_same_name_as_function() { 1435 fn test_hover_mod_with_same_name_as_function() {
1436 check( 1436 check(
1437 r#" 1437 r#"
1438use self::m<|>y::Bar; 1438use self::m$0y::Bar;
1439mod my { pub struct Bar; } 1439mod my { pub struct Bar; }
1440 1440
1441fn my() {} 1441fn my() {}
@@ -1461,7 +1461,7 @@ fn my() {}
1461/// bar docs 1461/// bar docs
1462struct Bar; 1462struct Bar;
1463 1463
1464fn foo() { let bar = Ba<|>r; } 1464fn foo() { let bar = Ba$0r; }
1465"#, 1465"#,
1466 expect![[r#" 1466 expect![[r#"
1467 *Bar* 1467 *Bar*
@@ -1488,7 +1488,7 @@ fn foo() { let bar = Ba<|>r; }
1488#[doc = "bar docs"] 1488#[doc = "bar docs"]
1489struct Bar; 1489struct Bar;
1490 1490
1491fn foo() { let bar = Ba<|>r; } 1491fn foo() { let bar = Ba$0r; }
1492"#, 1492"#,
1493 expect![[r#" 1493 expect![[r#"
1494 *Bar* 1494 *Bar*
@@ -1517,7 +1517,7 @@ fn foo() { let bar = Ba<|>r; }
1517#[doc = "bar docs 2"] 1517#[doc = "bar docs 2"]
1518struct Bar; 1518struct Bar;
1519 1519
1520fn foo() { let bar = Ba<|>r; } 1520fn foo() { let bar = Ba$0r; }
1521"#, 1521"#,
1522 expect![[r#" 1522 expect![[r#"
1523 *Bar* 1523 *Bar*
@@ -1545,7 +1545,7 @@ fn foo() { let bar = Ba<|>r; }
1545 r#" 1545 r#"
1546pub struct Foo; 1546pub struct Foo;
1547/// [Foo](struct.Foo.html) 1547/// [Foo](struct.Foo.html)
1548pub struct B<|>ar 1548pub struct B$0ar
1549"#, 1549"#,
1550 expect![[r#" 1550 expect![[r#"
1551 *Bar* 1551 *Bar*
@@ -1571,7 +1571,7 @@ pub struct B<|>ar
1571 r#" 1571 r#"
1572pub struct Foo; 1572pub struct Foo;
1573/// [struct Foo](struct.Foo.html) 1573/// [struct Foo](struct.Foo.html)
1574pub struct B<|>ar 1574pub struct B$0ar
1575"#, 1575"#,
1576 expect![[r#" 1576 expect![[r#"
1577 *Bar* 1577 *Bar*
@@ -1599,7 +1599,7 @@ pub struct B<|>ar
1599pub struct Foo; 1599pub struct Foo;
1600pub struct Bar { 1600pub struct Bar {
1601 /// [Foo](struct.Foo.html) 1601 /// [Foo](struct.Foo.html)
1602 fie<|>ld: () 1602 fie$0ld: ()
1603} 1603}
1604"#, 1604"#,
1605 expect![[r#" 1605 expect![[r#"
@@ -1628,7 +1628,7 @@ pub mod foo {
1628 pub struct Foo; 1628 pub struct Foo;
1629} 1629}
1630/// [Foo](foo::Foo) 1630/// [Foo](foo::Foo)
1631pub struct B<|>ar 1631pub struct B$0ar
1632"#, 1632"#,
1633 expect![[r#" 1633 expect![[r#"
1634 *Bar* 1634 *Bar*
@@ -1658,7 +1658,7 @@ pub mod foo {
1658 pub struct Foo; 1658 pub struct Foo;
1659} 1659}
1660/// [Foo](foo::Foo) 1660/// [Foo](foo::Foo)
1661pub struct B<|>ar 1661pub struct B$0ar
1662"#, 1662"#,
1663 expect![[r#" 1663 expect![[r#"
1664 *Bar* 1664 *Bar*
@@ -1684,7 +1684,7 @@ pub struct B<|>ar
1684 r#" 1684 r#"
1685pub struct Foo; 1685pub struct Foo;
1686/// [Foo] 1686/// [Foo]
1687pub struct B<|>ar 1687pub struct B$0ar
1688"#, 1688"#,
1689 expect![[r#" 1689 expect![[r#"
1690 *Bar* 1690 *Bar*
@@ -1710,7 +1710,7 @@ pub struct B<|>ar
1710 r#" 1710 r#"
1711pub struct Foo; 1711pub struct Foo;
1712/// [`Foo`] 1712/// [`Foo`]
1713pub struct B<|>ar 1713pub struct B$0ar
1714"#, 1714"#,
1715 expect![[r#" 1715 expect![[r#"
1716 *Bar* 1716 *Bar*
@@ -1737,7 +1737,7 @@ pub struct B<|>ar
1737pub struct Foo; 1737pub struct Foo;
1738fn Foo() {} 1738fn Foo() {}
1739/// [Foo()] 1739/// [Foo()]
1740pub struct B<|>ar 1740pub struct B$0ar
1741"#, 1741"#,
1742 expect![[r#" 1742 expect![[r#"
1743 *Bar* 1743 *Bar*
@@ -1763,7 +1763,7 @@ pub struct B<|>ar
1763 r#" 1763 r#"
1764pub struct Foo; 1764pub struct Foo;
1765/// [`struct Foo`] 1765/// [`struct Foo`]
1766pub struct B<|>ar 1766pub struct B$0ar
1767"#, 1767"#,
1768 expect![[r#" 1768 expect![[r#"
1769 *Bar* 1769 *Bar*
@@ -1789,7 +1789,7 @@ pub struct B<|>ar
1789 r#" 1789 r#"
1790pub struct Foo; 1790pub struct Foo;
1791/// [`struct@Foo`] 1791/// [`struct@Foo`]
1792pub struct B<|>ar 1792pub struct B$0ar
1793"#, 1793"#,
1794 expect![[r#" 1794 expect![[r#"
1795 *Bar* 1795 *Bar*
@@ -1817,7 +1817,7 @@ pub struct Foo;
1817/// [my Foo][foo] 1817/// [my Foo][foo]
1818/// 1818///
1819/// [foo]: Foo 1819/// [foo]: Foo
1820pub struct B<|>ar 1820pub struct B$0ar
1821"#, 1821"#,
1822 expect![[r#" 1822 expect![[r#"
1823 *Bar* 1823 *Bar*
@@ -1843,7 +1843,7 @@ pub struct B<|>ar
1843 r#" 1843 r#"
1844pub struct Foo; 1844pub struct Foo;
1845/// [external](https://www.google.com) 1845/// [external](https://www.google.com)
1846pub struct B<|>ar 1846pub struct B$0ar
1847"#, 1847"#,
1848 expect![[r#" 1848 expect![[r#"
1849 *Bar* 1849 *Bar*
@@ -1870,7 +1870,7 @@ pub struct B<|>ar
1870 r#" 1870 r#"
1871pub struct Foo; 1871pub struct Foo;
1872/// [baz](Baz) 1872/// [baz](Baz)
1873pub struct B<|>ar 1873pub struct B$0ar
1874"#, 1874"#,
1875 expect![[r#" 1875 expect![[r#"
1876 *Bar* 1876 *Bar*
@@ -1896,7 +1896,7 @@ pub struct B<|>ar
1896 r#" 1896 r#"
1897enum E { 1897enum E {
1898 /// [E] 1898 /// [E]
1899 V<|> { field: i32 } 1899 V$0 { field: i32 }
1900} 1900}
1901"#, 1901"#,
1902 expect![[r#" 1902 expect![[r#"
@@ -1923,7 +1923,7 @@ enum E {
1923 r#" 1923 r#"
1924struct S { 1924struct S {
1925 /// [`S`] 1925 /// [`S`]
1926 field<|>: i32 1926 field$0: i32
1927} 1927}
1928"#, 1928"#,
1929 expect![[r#" 1929 expect![[r#"
@@ -1969,7 +1969,7 @@ struct S {
1969/// 1969///
1970/// [`Result`]: ../../std/result/enum.Result.html 1970/// [`Result`]: ../../std/result/enum.Result.html
1971/// [^example]: https://www.example.com/ 1971/// [^example]: https://www.example.com/
1972pub fn fo<|>o() {} 1972pub fn fo$0o() {}
1973"#, 1973"#,
1974 expect![[r#" 1974 expect![[r#"
1975 *foo* 1975 *foo*
@@ -2026,7 +2026,7 @@ macro_rules! bar {
2026 2026
2027bar!(); 2027bar!();
2028 2028
2029fn foo() { let bar = Bar; bar.fo<|>o(); } 2029fn foo() { let bar = Bar; bar.fo$0o(); }
2030"#, 2030"#,
2031 expect![[r#" 2031 expect![[r#"
2032 *foo* 2032 *foo*
@@ -2064,7 +2064,7 @@ macro_rules! bar {
2064 2064
2065bar!(); 2065bar!();
2066 2066
2067fn foo() { let bar = Bar; bar.fo<|>o(); } 2067fn foo() { let bar = Bar; bar.fo$0o(); }
2068"#, 2068"#,
2069 expect![[r#" 2069 expect![[r#"
2070 *foo* 2070 *foo*
@@ -2087,7 +2087,7 @@ fn foo() { let bar = Bar; bar.fo<|>o(); }
2087 #[test] 2087 #[test]
2088 fn test_hover_trait_has_impl_action() { 2088 fn test_hover_trait_has_impl_action() {
2089 check_actions( 2089 check_actions(
2090 r#"trait foo<|>() {}"#, 2090 r#"trait foo$0() {}"#,
2091 expect![[r#" 2091 expect![[r#"
2092 [ 2092 [
2093 Implementation( 2093 Implementation(
@@ -2106,7 +2106,7 @@ fn foo() { let bar = Bar; bar.fo<|>o(); }
2106 #[test] 2106 #[test]
2107 fn test_hover_struct_has_impl_action() { 2107 fn test_hover_struct_has_impl_action() {
2108 check_actions( 2108 check_actions(
2109 r"struct foo<|>() {}", 2109 r"struct foo$0() {}",
2110 expect![[r#" 2110 expect![[r#"
2111 [ 2111 [
2112 Implementation( 2112 Implementation(
@@ -2125,7 +2125,7 @@ fn foo() { let bar = Bar; bar.fo<|>o(); }
2125 #[test] 2125 #[test]
2126 fn test_hover_union_has_impl_action() { 2126 fn test_hover_union_has_impl_action() {
2127 check_actions( 2127 check_actions(
2128 r#"union foo<|>() {}"#, 2128 r#"union foo$0() {}"#,
2129 expect![[r#" 2129 expect![[r#"
2130 [ 2130 [
2131 Implementation( 2131 Implementation(
@@ -2144,7 +2144,7 @@ fn foo() { let bar = Bar; bar.fo<|>o(); }
2144 #[test] 2144 #[test]
2145 fn test_hover_enum_has_impl_action() { 2145 fn test_hover_enum_has_impl_action() {
2146 check_actions( 2146 check_actions(
2147 r"enum foo<|>() { A, B }", 2147 r"enum foo$0() { A, B }",
2148 expect![[r#" 2148 expect![[r#"
2149 [ 2149 [
2150 Implementation( 2150 Implementation(
@@ -2163,7 +2163,7 @@ fn foo() { let bar = Bar; bar.fo<|>o(); }
2163 #[test] 2163 #[test]
2164 fn test_hover_self_has_impl_action() { 2164 fn test_hover_self_has_impl_action() {
2165 check_actions( 2165 check_actions(
2166 r#"struct foo where Self<|>:;"#, 2166 r#"struct foo where Self$0:;"#,
2167 expect![[r#" 2167 expect![[r#"
2168 [ 2168 [
2169 Implementation( 2169 Implementation(
@@ -2184,7 +2184,7 @@ fn foo() { let bar = Bar; bar.fo<|>o(); }
2184 check_actions( 2184 check_actions(
2185 r#" 2185 r#"
2186#[test] 2186#[test]
2187fn foo_<|>test() {} 2187fn foo_$0test() {}
2188"#, 2188"#,
2189 expect![[r#" 2189 expect![[r#"
2190 [ 2190 [
@@ -2219,7 +2219,7 @@ fn foo_<|>test() {}
2219 fn test_hover_test_mod_has_action() { 2219 fn test_hover_test_mod_has_action() {
2220 check_actions( 2220 check_actions(
2221 r#" 2221 r#"
2222mod tests<|> { 2222mod tests$0 {
2223 #[test] 2223 #[test]
2224 fn foo_test() {} 2224 fn foo_test() {}
2225} 2225}
@@ -2254,7 +2254,7 @@ mod tests<|> {
2254 r#" 2254 r#"
2255struct S{ f1: u32 } 2255struct S{ f1: u32 }
2256 2256
2257fn main() { let s<|>t = S{ f1:0 }; } 2257fn main() { let s$0t = S{ f1:0 }; }
2258 "#, 2258 "#,
2259 expect![[r#" 2259 expect![[r#"
2260 [ 2260 [
@@ -2287,7 +2287,7 @@ fn main() { let s<|>t = S{ f1:0 }; }
2287struct Arg(u32); 2287struct Arg(u32);
2288struct S<T>{ f1: T } 2288struct S<T>{ f1: T }
2289 2289
2290fn main() { let s<|>t = S{ f1:Arg(0) }; } 2290fn main() { let s$0t = S{ f1:Arg(0) }; }
2291"#, 2291"#,
2292 expect![[r#" 2292 expect![[r#"
2293 [ 2293 [
@@ -2333,7 +2333,7 @@ fn main() { let s<|>t = S{ f1:Arg(0) }; }
2333struct Arg(u32); 2333struct Arg(u32);
2334struct S<T>{ f1: T } 2334struct S<T>{ f1: T }
2335 2335
2336fn main() { let s<|>t = S{ f1: S{ f1: Arg(0) } }; } 2336fn main() { let s$0t = S{ f1: S{ f1: Arg(0) } }; }
2337 "#, 2337 "#,
2338 expect![[r#" 2338 expect![[r#"
2339 [ 2339 [
@@ -2382,7 +2382,7 @@ mod M {
2382 pub struct C(u32); 2382 pub struct C(u32);
2383} 2383}
2384 2384
2385fn main() { let s<|>t = (A(1), B(2), M::C(3) ); } 2385fn main() { let s$0t = (A(1), B(2), M::C(3) ); }
2386"#, 2386"#,
2387 expect![[r#" 2387 expect![[r#"
2388 [ 2388 [
@@ -2441,7 +2441,7 @@ fn main() { let s<|>t = (A(1), B(2), M::C(3) ); }
2441trait Foo {} 2441trait Foo {}
2442fn foo() -> impl Foo {} 2442fn foo() -> impl Foo {}
2443 2443
2444fn main() { let s<|>t = foo(); } 2444fn main() { let s$0t = foo(); }
2445"#, 2445"#,
2446 expect![[r#" 2446 expect![[r#"
2447 [ 2447 [
@@ -2475,7 +2475,7 @@ trait Foo<T> {}
2475struct S; 2475struct S;
2476fn foo() -> impl Foo<S> {} 2476fn foo() -> impl Foo<S> {}
2477 2477
2478fn main() { let s<|>t = foo(); } 2478fn main() { let s$0t = foo(); }
2479"#, 2479"#,
2480 expect![[r#" 2480 expect![[r#"
2481 [ 2481 [
@@ -2522,7 +2522,7 @@ trait Foo {}
2522trait Bar {} 2522trait Bar {}
2523fn foo() -> impl Foo + Bar {} 2523fn foo() -> impl Foo + Bar {}
2524 2524
2525fn main() { let s<|>t = foo(); } 2525fn main() { let s$0t = foo(); }
2526 "#, 2526 "#,
2527 expect![[r#" 2527 expect![[r#"
2528 [ 2528 [
@@ -2572,7 +2572,7 @@ struct S2 {}
2572 2572
2573fn foo() -> impl Foo<S1> + Bar<S2> {} 2573fn foo() -> impl Foo<S1> + Bar<S2> {}
2574 2574
2575fn main() { let s<|>t = foo(); } 2575fn main() { let s$0t = foo(); }
2576"#, 2576"#,
2577 expect![[r#" 2577 expect![[r#"
2578 [ 2578 [
@@ -2642,7 +2642,7 @@ fn main() { let s<|>t = foo(); }
2642 check_actions( 2642 check_actions(
2643 r#" 2643 r#"
2644trait Foo {} 2644trait Foo {}
2645fn foo(ar<|>g: &impl Foo) {} 2645fn foo(ar$0g: &impl Foo) {}
2646"#, 2646"#,
2647 expect![[r#" 2647 expect![[r#"
2648 [ 2648 [
@@ -2676,7 +2676,7 @@ trait Foo {}
2676trait Bar<T> {} 2676trait Bar<T> {}
2677struct S{} 2677struct S{}
2678 2678
2679fn foo(ar<|>g: &impl Foo + Bar<S>) {} 2679fn foo(ar$0g: &impl Foo + Bar<S>) {}
2680"#, 2680"#,
2681 expect![[r#" 2681 expect![[r#"
2682 [ 2682 [
@@ -2734,7 +2734,7 @@ fn foo(ar<|>g: &impl Foo + Bar<S>) {}
2734 r#" 2734 r#"
2735struct S; 2735struct S;
2736fn foo() { 2736fn foo() {
2737 let fo<|>o = async { S }; 2737 let fo$0o = async { S };
2738} 2738}
2739 2739
2740#[prelude_import] use future::*; 2740#[prelude_import] use future::*;
@@ -2786,7 +2786,7 @@ mod future {
2786 r#" 2786 r#"
2787trait Foo<T> {} 2787trait Foo<T> {}
2788struct S {} 2788struct S {}
2789fn foo(ar<|>g: &impl Foo<S>) {} 2789fn foo(ar$0g: &impl Foo<S>) {}
2790"#, 2790"#,
2791 expect![[r#" 2791 expect![[r#"
2792 [ 2792 [
@@ -2836,7 +2836,7 @@ impl Foo for S {}
2836struct B<T>{} 2836struct B<T>{}
2837fn foo() -> B<dyn Foo> {} 2837fn foo() -> B<dyn Foo> {}
2838 2838
2839fn main() { let s<|>t = foo(); } 2839fn main() { let s$0t = foo(); }
2840"#, 2840"#,
2841 expect![[r#" 2841 expect![[r#"
2842 [ 2842 [
@@ -2880,7 +2880,7 @@ fn main() { let s<|>t = foo(); }
2880 check_actions( 2880 check_actions(
2881 r#" 2881 r#"
2882trait Foo {} 2882trait Foo {}
2883fn foo(ar<|>g: &dyn Foo) {} 2883fn foo(ar$0g: &dyn Foo) {}
2884"#, 2884"#,
2885 expect![[r#" 2885 expect![[r#"
2886 [ 2886 [
@@ -2912,7 +2912,7 @@ fn foo(ar<|>g: &dyn Foo) {}
2912 r#" 2912 r#"
2913trait Foo<T> {} 2913trait Foo<T> {}
2914struct S {} 2914struct S {}
2915fn foo(ar<|>g: &dyn Foo<S>) {} 2915fn foo(ar$0g: &dyn Foo<S>) {}
2916"#, 2916"#,
2917 expect![[r#" 2917 expect![[r#"
2918 [ 2918 [
@@ -2960,7 +2960,7 @@ trait DynTrait<T> {}
2960struct B<T> {} 2960struct B<T> {}
2961struct S {} 2961struct S {}
2962 2962
2963fn foo(a<|>rg: &impl ImplTrait<B<dyn DynTrait<B<S>>>>) {} 2963fn foo(a$0rg: &impl ImplTrait<B<dyn DynTrait<B<S>>>>) {}
2964 "#, 2964 "#,
2965 expect![[r#" 2965 expect![[r#"
2966 [ 2966 [
@@ -3041,7 +3041,7 @@ impl Foo for S { type Item = Bar; }
3041 3041
3042fn test() -> impl Foo { S {} } 3042fn test() -> impl Foo { S {} }
3043 3043
3044fn main() { let s<|>t = test().get(); } 3044fn main() { let s$0t = test().get(); }
3045"#, 3045"#,
3046 expect![[r#" 3046 expect![[r#"
3047 [ 3047 [
@@ -3074,7 +3074,7 @@ fn main() { let s<|>t = test().get(); }
3074struct Bar; 3074struct Bar;
3075struct Foo<const BAR: Bar>; 3075struct Foo<const BAR: Bar>;
3076 3076
3077impl<const BAR: Bar> Foo<BAR<|>> {} 3077impl<const BAR: Bar> Foo<BAR$0> {}
3078"#, 3078"#,
3079 expect![[r#" 3079 expect![[r#"
3080 [ 3080 [
@@ -3106,7 +3106,7 @@ impl<const BAR: Bar> Foo<BAR<|>> {}
3106 r#" 3106 r#"
3107trait Foo {} 3107trait Foo {}
3108 3108
3109fn foo<T: Foo>(t: T<|>){} 3109fn foo<T: Foo>(t: T$0){}
3110"#, 3110"#,
3111 expect![[r#" 3111 expect![[r#"
3112 [ 3112 [
@@ -3146,7 +3146,7 @@ pub mod wrapper {
3146} 3146}
3147 3147
3148//- /main.rs crate:main deps:name-with-dashes 3148//- /main.rs crate:main deps:name-with-dashes
3149fn main() { let foo_test = name_with_dashes::wrapper::Thing::new<|>(); } 3149fn main() { let foo_test = name_with_dashes::wrapper::Thing::new$0(); }
3150"#, 3150"#,
3151 expect![[r#" 3151 expect![[r#"
3152 *new* 3152 *new*
@@ -3172,7 +3172,7 @@ struct S {
3172 3172
3173fn main() { 3173fn main() {
3174 let s = S { f: 0 }; 3174 let s = S { f: 0 };
3175 let S { f<|> } = &s; 3175 let S { f$0 } = &s;
3176} 3176}
3177"#, 3177"#,
3178 expect![[r#" 3178 expect![[r#"
@@ -3191,7 +3191,7 @@ fn main() {
3191 r#" 3191 r#"
3192struct Foo {} 3192struct Foo {}
3193impl Foo { 3193impl Foo {
3194 fn bar(&sel<|>f) {} 3194 fn bar(&sel$0f) {}
3195} 3195}
3196"#, 3196"#,
3197 expect![[r#" 3197 expect![[r#"
@@ -3210,7 +3210,7 @@ impl Foo {
3210struct Arc<T>(T); 3210struct Arc<T>(T);
3211struct Foo {} 3211struct Foo {}
3212impl Foo { 3212impl Foo {
3213 fn bar(sel<|>f: Arc<Foo>) {} 3213 fn bar(sel$0f: Arc<Foo>) {}
3214} 3214}
3215"#, 3215"#,
3216 expect![[r#" 3216 expect![[r#"
@@ -3227,7 +3227,7 @@ impl Foo {
3227 check( 3227 check(
3228 r#" 3228 r#"
3229/// Be quick; 3229/// Be quick;
3230mod Foo<|> { 3230mod Foo$0 {
3231 //! time is mana 3231 //! time is mana
3232 3232
3233 /// This comment belongs to the function 3233 /// This comment belongs to the function
@@ -3258,7 +3258,7 @@ mod Foo<|> {
3258 check( 3258 check(
3259 r#" 3259 r#"
3260#[doc = "Be quick;"] 3260#[doc = "Be quick;"]
3261mod Foo<|> { 3261mod Foo$0 {
3262 #![doc = "time is mana"] 3262 #![doc = "time is mana"]
3263 3263
3264 #[doc = "This comment belongs to the function"] 3264 #[doc = "This comment belongs to the function"]
@@ -3289,7 +3289,7 @@ mod Foo<|> {
3289 check_hover_no_result( 3289 check_hover_no_result(
3290 r#" 3290 r#"
3291fn no_hover() { 3291fn no_hover() {
3292 // no<|>hover 3292 // no$0hover
3293} 3293}
3294"#, 3294"#,
3295 ); 3295 );
@@ -3300,7 +3300,7 @@ fn no_hover() {
3300 check( 3300 check(
3301 r#" 3301 r#"
3302fn foo() { 3302fn foo() {
3303 'label<|>: loop {} 3303 'label$0: loop {}
3304} 3304}
3305"#, 3305"#,
3306 expect![[r#" 3306 expect![[r#"
@@ -3316,7 +3316,7 @@ fn foo() {
3316 #[test] 3316 #[test]
3317 fn hover_lifetime() { 3317 fn hover_lifetime() {
3318 check( 3318 check(
3319 r#"fn foo<'lifetime>(_: &'lifetime<|> ()) {}"#, 3319 r#"fn foo<'lifetime>(_: &'lifetime$0 ()) {}"#,
3320 expect![[r#" 3320 expect![[r#"
3321 *'lifetime* 3321 *'lifetime*
3322 3322
@@ -3335,7 +3335,7 @@ struct Foo<T>(T);
3335trait Copy {} 3335trait Copy {}
3336trait Clone {} 3336trait Clone {}
3337trait Sized {} 3337trait Sized {}
3338impl<T: Copy + Clone> Foo<T<|>> where T: Sized {} 3338impl<T: Copy + Clone> Foo<T$0> where T: Sized {}
3339"#, 3339"#,
3340 expect![[r#" 3340 expect![[r#"
3341 *T* 3341 *T*
@@ -3348,7 +3348,7 @@ impl<T: Copy + Clone> Foo<T<|>> where T: Sized {}
3348 check( 3348 check(
3349 r#" 3349 r#"
3350struct Foo<T>(T); 3350struct Foo<T>(T);
3351impl<T> Foo<T<|>> {} 3351impl<T> Foo<T$0> {}
3352"#, 3352"#,
3353 expect![[r#" 3353 expect![[r#"
3354 *T* 3354 *T*
@@ -3362,7 +3362,7 @@ impl<T> Foo<T<|>> {}
3362 check( 3362 check(
3363 r#" 3363 r#"
3364struct Foo<T>(T); 3364struct Foo<T>(T);
3365impl<T: 'static> Foo<T<|>> {} 3365impl<T: 'static> Foo<T$0> {}
3366"#, 3366"#,
3367 expect![[r#" 3367 expect![[r#"
3368 *T* 3368 *T*
@@ -3379,7 +3379,7 @@ impl<T: 'static> Foo<T<|>> {}
3379 check( 3379 check(
3380 r#" 3380 r#"
3381struct Foo<const LEN: usize>; 3381struct Foo<const LEN: usize>;
3382impl<const LEN: usize> Foo<LEN<|>> {} 3382impl<const LEN: usize> Foo<LEN$0> {}
3383"#, 3383"#,
3384 expect![[r#" 3384 expect![[r#"
3385 *LEN* 3385 *LEN*