diff options
Diffstat (limited to 'crates/ide/src/hover.rs')
-rw-r--r-- | crates/ide/src/hover.rs | 216 |
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 { | |||
457 | pub fn foo() -> u32 { 1 } | 457 | pub fn foo() -> u32 { 1 } |
458 | 458 | ||
459 | fn main() { | 459 | fn 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() { | |||
476 | pub fn foo() -> u32 { 1 } | 476 | pub fn foo() -> u32 { 1 } |
477 | 477 | ||
478 | fn main() { | 478 | fn 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#" |
527 | pub fn foo() -> u32 { 1 } | 527 | pub fn foo() -> u32 { 1 } |
528 | 528 | ||
529 | fn main() { let foo_test = fo<|>o(); } | 529 | fn main() { let foo_test = fo$0o(); } |
530 | "#, | 530 | "#, |
531 | expect![[r#" | 531 | expect![[r#" |
532 | *foo* | 532 | *foo* |
@@ -558,7 +558,7 @@ mod a; | |||
558 | mod b; | 558 | mod b; |
559 | mod c; | 559 | mod c; |
560 | 560 | ||
561 | fn main() { let foo_test = fo<|>o(); } | 561 | fn 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#" |
576 | pub fn foo<'a, T: AsRef<str>>(b: &'a T) -> &'a str { } | 576 | pub fn foo<'a, T: AsRef<str>>(b: &'a T) -> &'a str { } |
577 | 577 | ||
578 | fn main() { let foo_test = fo<|>o(); } | 578 | fn 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#" |
598 | pub fn foo<|>(a: u32, b: u32) -> u32 {} | 598 | pub fn foo$0(a: u32, b: u32) -> u32 {} |
599 | 599 | ||
600 | fn main() { } | 600 | fn 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 | /// ``` |
626 | pub fn foo<|>(_: &Path) {} | 626 | pub fn foo$0(_: &Path) {} |
627 | 627 | ||
628 | fn main() { } | 628 | fn 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"#] |
659 | pub fn foo<|>(_: &Path) {} | 659 | pub fn foo$0(_: &Path) {} |
660 | 660 | ||
661 | fn main() { } | 661 | fn main() { } |
662 | "##, | 662 | "##, |
@@ -686,7 +686,7 @@ fn main() { } | |||
686 | struct Foo { field_a: u32 } | 686 | struct Foo { field_a: u32 } |
687 | 687 | ||
688 | fn main() { | 688 | fn 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#" |
708 | struct Foo { field_a<|>: u32 } | 708 | struct Foo { field_a$0: u32 } |
709 | 709 | ||
710 | fn main() { | 710 | fn 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() { | |||
764 | struct Test<K, T = u8> { k: K, t: T } | 764 | struct Test<K, T = u8> { k: K, t: T } |
765 | 765 | ||
766 | fn main() { | 766 | fn 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() { | |||
783 | enum Option<T> { Some(T) } | 783 | enum Option<T> { Some(T) } |
784 | use Option::Some; | 784 | use Option::Some; |
785 | 785 | ||
786 | fn main() { So<|>me(12); } | 786 | fn 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); } | |||
803 | enum Option<T> { Some(T) } | 803 | enum Option<T> { Some(T) } |
804 | use Option::Some; | 804 | use Option::Some; |
805 | 805 | ||
806 | fn main() { let b<|>ar = Some(12); } | 806 | fn 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#" |
822 | enum Option<T> { | 822 | enum 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 | } |
850 | fn main() { | 850 | fn 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 | ||
958 | fn main() { let foo_<|>test = Thing::new(); } | 958 | fn 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 | ||
982 | fn main() { let foo_test = wrapper::Thing::new<|>(); } | 982 | fn 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 | ||
1007 | fn main() { | 1007 | fn 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#" |
1033 | struct Thing { x: u32 } | 1033 | struct Thing { x: u32 } |
1034 | impl Thing { | 1034 | impl 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#" |
1052 | struct Thing { x: u32 } | 1052 | struct Thing { x: u32 } |
1053 | impl Thing { | 1053 | impl 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#" |
1071 | enum Thing { A } | 1071 | enum Thing { A } |
1072 | impl Thing { | 1072 | impl 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 | ||
1115 | fn y() { | 1115 | fn 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#" |
1134 | macro_rules! foo { () => {} } | 1134 | macro_rules! foo { () => {} } |
1135 | 1135 | ||
1136 | fn f() { fo<|>o!(); } | 1136 | fn 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!(); } | |||
1170 | macro_rules! id { ($($tt:tt)*) => { $($tt)* } } | 1170 | macro_rules! id { ($($tt:tt)*) => { $($tt)* } } |
1171 | fn foo() {} | 1171 | fn foo() {} |
1172 | id! { | 1172 | id! { |
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#" |
1194 | macro_rules! id { ($($tt:tt)*) => { $($tt)* } } | 1194 | macro_rules! id { ($($tt:tt)*) => { $($tt)* } } |
1195 | fn foo(bar:u32) { let a = id!(ba<|>r); } | 1195 | fn 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#" |
1211 | macro_rules! id_deep { ($($tt:tt)*) => { $($tt)* } } | 1211 | macro_rules! id_deep { ($($tt:tt)*) => { $($tt)* } } |
1212 | macro_rules! id { ($($tt:tt)*) => { id_deep!($($tt)*) } } | 1212 | macro_rules! id { ($($tt:tt)*) => { id_deep!($($tt)*) } } |
1213 | fn foo(bar:u32) { let a = id!(ba<|>r); } | 1213 | fn 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); } | |||
1229 | macro_rules! id_deep { ($($tt:tt)*) => { $($tt)* } } | 1229 | macro_rules! id_deep { ($($tt:tt)*) => { $($tt)* } } |
1230 | macro_rules! id { ($($tt:tt)*) => { id_deep!($($tt)*) } } | 1230 | macro_rules! id { ($($tt:tt)*) => { id_deep!($($tt)*) } } |
1231 | fn bar() -> u32 { 0 } | 1231 | fn bar() -> u32 { 0 } |
1232 | fn foo() { let a = id!([0u32, bar(<|>)] ); } | 1232 | fn 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(<|>)] ); } | |||
1247 | macro_rules! arr { ($($tt:tt)*) => { [$($tt)*)] } } | 1247 | macro_rules! arr { ($($tt:tt)*) => { [$($tt)*)] } } |
1248 | fn foo() { | 1248 | fn 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 | ||
1269 | fn bar() -> bool { true } | 1269 | fn bar() -> bool { true } |
1270 | fn foo() { | 1270 | fn 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 |
1307 | fn foo() { } | 1307 | fn foo() { } |
1308 | 1308 | ||
1309 | fn bar() { fo<|>o(); } | 1309 | fn 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 |
1399 | extern crate st<|>d; | 1399 | extern 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 |
1417 | extern crate std as ab<|>c; | 1417 | extern 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#" |
1438 | use self::m<|>y::Bar; | 1438 | use self::m$0y::Bar; |
1439 | mod my { pub struct Bar; } | 1439 | mod my { pub struct Bar; } |
1440 | 1440 | ||
1441 | fn my() {} | 1441 | fn my() {} |
@@ -1461,7 +1461,7 @@ fn my() {} | |||
1461 | /// bar docs | 1461 | /// bar docs |
1462 | struct Bar; | 1462 | struct Bar; |
1463 | 1463 | ||
1464 | fn foo() { let bar = Ba<|>r; } | 1464 | fn 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"] |
1489 | struct Bar; | 1489 | struct Bar; |
1490 | 1490 | ||
1491 | fn foo() { let bar = Ba<|>r; } | 1491 | fn 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"] |
1518 | struct Bar; | 1518 | struct Bar; |
1519 | 1519 | ||
1520 | fn foo() { let bar = Ba<|>r; } | 1520 | fn 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#" |
1546 | pub struct Foo; | 1546 | pub struct Foo; |
1547 | /// [Foo](struct.Foo.html) | 1547 | /// [Foo](struct.Foo.html) |
1548 | pub struct B<|>ar | 1548 | pub 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#" |
1572 | pub struct Foo; | 1572 | pub struct Foo; |
1573 | /// [struct Foo](struct.Foo.html) | 1573 | /// [struct Foo](struct.Foo.html) |
1574 | pub struct B<|>ar | 1574 | pub struct B$0ar |
1575 | "#, | 1575 | "#, |
1576 | expect![[r#" | 1576 | expect![[r#" |
1577 | *Bar* | 1577 | *Bar* |
@@ -1599,7 +1599,7 @@ pub struct B<|>ar | |||
1599 | pub struct Foo; | 1599 | pub struct Foo; |
1600 | pub struct Bar { | 1600 | pub 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) |
1631 | pub struct B<|>ar | 1631 | pub 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) |
1661 | pub struct B<|>ar | 1661 | pub 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#" |
1685 | pub struct Foo; | 1685 | pub struct Foo; |
1686 | /// [Foo] | 1686 | /// [Foo] |
1687 | pub struct B<|>ar | 1687 | pub 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#" |
1711 | pub struct Foo; | 1711 | pub struct Foo; |
1712 | /// [`Foo`] | 1712 | /// [`Foo`] |
1713 | pub struct B<|>ar | 1713 | pub struct B$0ar |
1714 | "#, | 1714 | "#, |
1715 | expect![[r#" | 1715 | expect![[r#" |
1716 | *Bar* | 1716 | *Bar* |
@@ -1737,7 +1737,7 @@ pub struct B<|>ar | |||
1737 | pub struct Foo; | 1737 | pub struct Foo; |
1738 | fn Foo() {} | 1738 | fn Foo() {} |
1739 | /// [Foo()] | 1739 | /// [Foo()] |
1740 | pub struct B<|>ar | 1740 | pub 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#" |
1764 | pub struct Foo; | 1764 | pub struct Foo; |
1765 | /// [`struct Foo`] | 1765 | /// [`struct Foo`] |
1766 | pub struct B<|>ar | 1766 | pub 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#" |
1790 | pub struct Foo; | 1790 | pub struct Foo; |
1791 | /// [`struct@Foo`] | 1791 | /// [`struct@Foo`] |
1792 | pub struct B<|>ar | 1792 | pub 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 |
1820 | pub struct B<|>ar | 1820 | pub 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#" |
1844 | pub struct Foo; | 1844 | pub struct Foo; |
1845 | /// [external](https://www.google.com) | 1845 | /// [external](https://www.google.com) |
1846 | pub struct B<|>ar | 1846 | pub 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#" |
1871 | pub struct Foo; | 1871 | pub struct Foo; |
1872 | /// [baz](Baz) | 1872 | /// [baz](Baz) |
1873 | pub struct B<|>ar | 1873 | pub 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#" |
1897 | enum E { | 1897 | enum 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#" |
1924 | struct S { | 1924 | struct 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/ |
1972 | pub fn fo<|>o() {} | 1972 | pub fn fo$0o() {} |
1973 | "#, | 1973 | "#, |
1974 | expect![[r#" | 1974 | expect![[r#" |
1975 | *foo* | 1975 | *foo* |
@@ -2026,7 +2026,7 @@ macro_rules! bar { | |||
2026 | 2026 | ||
2027 | bar!(); | 2027 | bar!(); |
2028 | 2028 | ||
2029 | fn foo() { let bar = Bar; bar.fo<|>o(); } | 2029 | fn 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 | ||
2065 | bar!(); | 2065 | bar!(); |
2066 | 2066 | ||
2067 | fn foo() { let bar = Bar; bar.fo<|>o(); } | 2067 | fn 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] |
2187 | fn foo_<|>test() {} | 2187 | fn 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#" |
2222 | mod tests<|> { | 2222 | mod 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#" |
2255 | struct S{ f1: u32 } | 2255 | struct S{ f1: u32 } |
2256 | 2256 | ||
2257 | fn main() { let s<|>t = S{ f1:0 }; } | 2257 | fn 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 }; } | |||
2287 | struct Arg(u32); | 2287 | struct Arg(u32); |
2288 | struct S<T>{ f1: T } | 2288 | struct S<T>{ f1: T } |
2289 | 2289 | ||
2290 | fn main() { let s<|>t = S{ f1:Arg(0) }; } | 2290 | fn 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) }; } | |||
2333 | struct Arg(u32); | 2333 | struct Arg(u32); |
2334 | struct S<T>{ f1: T } | 2334 | struct S<T>{ f1: T } |
2335 | 2335 | ||
2336 | fn main() { let s<|>t = S{ f1: S{ f1: Arg(0) } }; } | 2336 | fn 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 | ||
2385 | fn main() { let s<|>t = (A(1), B(2), M::C(3) ); } | 2385 | fn 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) ); } | |||
2441 | trait Foo {} | 2441 | trait Foo {} |
2442 | fn foo() -> impl Foo {} | 2442 | fn foo() -> impl Foo {} |
2443 | 2443 | ||
2444 | fn main() { let s<|>t = foo(); } | 2444 | fn main() { let s$0t = foo(); } |
2445 | "#, | 2445 | "#, |
2446 | expect![[r#" | 2446 | expect![[r#" |
2447 | [ | 2447 | [ |
@@ -2475,7 +2475,7 @@ trait Foo<T> {} | |||
2475 | struct S; | 2475 | struct S; |
2476 | fn foo() -> impl Foo<S> {} | 2476 | fn foo() -> impl Foo<S> {} |
2477 | 2477 | ||
2478 | fn main() { let s<|>t = foo(); } | 2478 | fn main() { let s$0t = foo(); } |
2479 | "#, | 2479 | "#, |
2480 | expect![[r#" | 2480 | expect![[r#" |
2481 | [ | 2481 | [ |
@@ -2522,7 +2522,7 @@ trait Foo {} | |||
2522 | trait Bar {} | 2522 | trait Bar {} |
2523 | fn foo() -> impl Foo + Bar {} | 2523 | fn foo() -> impl Foo + Bar {} |
2524 | 2524 | ||
2525 | fn main() { let s<|>t = foo(); } | 2525 | fn main() { let s$0t = foo(); } |
2526 | "#, | 2526 | "#, |
2527 | expect![[r#" | 2527 | expect![[r#" |
2528 | [ | 2528 | [ |
@@ -2572,7 +2572,7 @@ struct S2 {} | |||
2572 | 2572 | ||
2573 | fn foo() -> impl Foo<S1> + Bar<S2> {} | 2573 | fn foo() -> impl Foo<S1> + Bar<S2> {} |
2574 | 2574 | ||
2575 | fn main() { let s<|>t = foo(); } | 2575 | fn 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#" |
2644 | trait Foo {} | 2644 | trait Foo {} |
2645 | fn foo(ar<|>g: &impl Foo) {} | 2645 | fn foo(ar$0g: &impl Foo) {} |
2646 | "#, | 2646 | "#, |
2647 | expect![[r#" | 2647 | expect![[r#" |
2648 | [ | 2648 | [ |
@@ -2676,7 +2676,7 @@ trait Foo {} | |||
2676 | trait Bar<T> {} | 2676 | trait Bar<T> {} |
2677 | struct S{} | 2677 | struct S{} |
2678 | 2678 | ||
2679 | fn foo(ar<|>g: &impl Foo + Bar<S>) {} | 2679 | fn 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#" |
2735 | struct S; | 2735 | struct S; |
2736 | fn foo() { | 2736 | fn 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#" |
2787 | trait Foo<T> {} | 2787 | trait Foo<T> {} |
2788 | struct S {} | 2788 | struct S {} |
2789 | fn foo(ar<|>g: &impl Foo<S>) {} | 2789 | fn foo(ar$0g: &impl Foo<S>) {} |
2790 | "#, | 2790 | "#, |
2791 | expect![[r#" | 2791 | expect![[r#" |
2792 | [ | 2792 | [ |
@@ -2836,7 +2836,7 @@ impl Foo for S {} | |||
2836 | struct B<T>{} | 2836 | struct B<T>{} |
2837 | fn foo() -> B<dyn Foo> {} | 2837 | fn foo() -> B<dyn Foo> {} |
2838 | 2838 | ||
2839 | fn main() { let s<|>t = foo(); } | 2839 | fn 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#" |
2882 | trait Foo {} | 2882 | trait Foo {} |
2883 | fn foo(ar<|>g: &dyn Foo) {} | 2883 | fn 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#" |
2913 | trait Foo<T> {} | 2913 | trait Foo<T> {} |
2914 | struct S {} | 2914 | struct S {} |
2915 | fn foo(ar<|>g: &dyn Foo<S>) {} | 2915 | fn foo(ar$0g: &dyn Foo<S>) {} |
2916 | "#, | 2916 | "#, |
2917 | expect![[r#" | 2917 | expect![[r#" |
2918 | [ | 2918 | [ |
@@ -2960,7 +2960,7 @@ trait DynTrait<T> {} | |||
2960 | struct B<T> {} | 2960 | struct B<T> {} |
2961 | struct S {} | 2961 | struct S {} |
2962 | 2962 | ||
2963 | fn foo(a<|>rg: &impl ImplTrait<B<dyn DynTrait<B<S>>>>) {} | 2963 | fn 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 | ||
3042 | fn test() -> impl Foo { S {} } | 3042 | fn test() -> impl Foo { S {} } |
3043 | 3043 | ||
3044 | fn main() { let s<|>t = test().get(); } | 3044 | fn 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(); } | |||
3074 | struct Bar; | 3074 | struct Bar; |
3075 | struct Foo<const BAR: Bar>; | 3075 | struct Foo<const BAR: Bar>; |
3076 | 3076 | ||
3077 | impl<const BAR: Bar> Foo<BAR<|>> {} | 3077 | impl<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#" |
3107 | trait Foo {} | 3107 | trait Foo {} |
3108 | 3108 | ||
3109 | fn foo<T: Foo>(t: T<|>){} | 3109 | fn 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 |
3149 | fn main() { let foo_test = name_with_dashes::wrapper::Thing::new<|>(); } | 3149 | fn 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 | ||
3173 | fn main() { | 3173 | fn 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#" |
3192 | struct Foo {} | 3192 | struct Foo {} |
3193 | impl Foo { | 3193 | impl 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 { | |||
3210 | struct Arc<T>(T); | 3210 | struct Arc<T>(T); |
3211 | struct Foo {} | 3211 | struct Foo {} |
3212 | impl Foo { | 3212 | impl 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; |
3230 | mod Foo<|> { | 3230 | mod 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;"] |
3261 | mod Foo<|> { | 3261 | mod 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#" |
3291 | fn no_hover() { | 3291 | fn 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#" |
3302 | fn foo() { | 3302 | fn 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); | |||
3335 | trait Copy {} | 3335 | trait Copy {} |
3336 | trait Clone {} | 3336 | trait Clone {} |
3337 | trait Sized {} | 3337 | trait Sized {} |
3338 | impl<T: Copy + Clone> Foo<T<|>> where T: Sized {} | 3338 | impl<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#" |
3350 | struct Foo<T>(T); | 3350 | struct Foo<T>(T); |
3351 | impl<T> Foo<T<|>> {} | 3351 | impl<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#" |
3364 | struct Foo<T>(T); | 3364 | struct Foo<T>(T); |
3365 | impl<T: 'static> Foo<T<|>> {} | 3365 | impl<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#" |
3381 | struct Foo<const LEN: usize>; | 3381 | struct Foo<const LEN: usize>; |
3382 | impl<const LEN: usize> Foo<LEN<|>> {} | 3382 | impl<const LEN: usize> Foo<LEN$0> {} |
3383 | "#, | 3383 | "#, |
3384 | expect![[r#" | 3384 | expect![[r#" |
3385 | *LEN* | 3385 | *LEN* |