aboutsummaryrefslogtreecommitdiff
path: root/crates/assists/src/handlers/qualify_path.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/assists/src/handlers/qualify_path.rs')
-rw-r--r--crates/assists/src/handlers/qualify_path.rs76
1 files changed, 38 insertions, 38 deletions
diff --git a/crates/assists/src/handlers/qualify_path.rs b/crates/assists/src/handlers/qualify_path.rs
index 98cb09214..f7fbf37f4 100644
--- a/crates/assists/src/handlers/qualify_path.rs
+++ b/crates/assists/src/handlers/qualify_path.rs
@@ -22,7 +22,7 @@ use crate::{
22// 22//
23// ``` 23// ```
24// fn main() { 24// fn main() {
25// let map = HashMap<|>::new(); 25// let map = HashMap$0::new();
26// } 26// }
27// # pub mod std { pub mod collections { pub struct HashMap { } } } 27// # pub mod std { pub mod collections { pub struct HashMap { } } }
28// ``` 28// ```
@@ -221,7 +221,7 @@ mod tests {
221 221
222 use std::fmt; 222 use std::fmt;
223 223
224 <|>Formatter 224 $0Formatter
225 ", 225 ",
226 r" 226 r"
227 mod std { 227 mod std {
@@ -242,7 +242,7 @@ mod tests {
242 check_assist( 242 check_assist(
243 qualify_path, 243 qualify_path,
244 r" 244 r"
245 <|>PubStruct 245 $0PubStruct
246 246
247 pub mod PubMod { 247 pub mod PubMod {
248 pub struct PubStruct; 248 pub struct PubStruct;
@@ -266,7 +266,7 @@ mod tests {
266 macro_rules! foo { 266 macro_rules! foo {
267 ($i:ident) => { fn foo(a: $i) {} } 267 ($i:ident) => { fn foo(a: $i) {} }
268 } 268 }
269 foo!(Pub<|>Struct); 269 foo!(Pub$0Struct);
270 270
271 pub mod PubMod { 271 pub mod PubMod {
272 pub struct PubStruct; 272 pub struct PubStruct;
@@ -290,7 +290,7 @@ mod tests {
290 check_assist( 290 check_assist(
291 qualify_path, 291 qualify_path,
292 r" 292 r"
293 PubSt<|>ruct 293 PubSt$0ruct
294 294
295 pub mod PubMod1 { 295 pub mod PubMod1 {
296 pub struct PubStruct; 296 pub struct PubStruct;
@@ -325,7 +325,7 @@ mod tests {
325 r" 325 r"
326 use PubMod::PubStruct; 326 use PubMod::PubStruct;
327 327
328 PubStruct<|> 328 PubStruct$0
329 329
330 pub mod PubMod { 330 pub mod PubMod {
331 pub struct PubStruct; 331 pub struct PubStruct;
@@ -339,7 +339,7 @@ mod tests {
339 check_assist_not_applicable( 339 check_assist_not_applicable(
340 qualify_path, 340 qualify_path,
341 r" 341 r"
342 PrivateStruct<|> 342 PrivateStruct$0
343 343
344 pub mod PubMod { 344 pub mod PubMod {
345 struct PrivateStruct; 345 struct PrivateStruct;
@@ -353,7 +353,7 @@ mod tests {
353 check_assist_not_applicable( 353 check_assist_not_applicable(
354 qualify_path, 354 qualify_path,
355 " 355 "
356 PubStruct<|>", 356 PubStruct$0",
357 ); 357 );
358 } 358 }
359 359
@@ -362,7 +362,7 @@ mod tests {
362 check_assist_not_applicable( 362 check_assist_not_applicable(
363 qualify_path, 363 qualify_path,
364 r" 364 r"
365 use PubStruct<|>; 365 use PubStruct$0;
366 366
367 pub mod PubMod { 367 pub mod PubMod {
368 pub struct PubStruct; 368 pub struct PubStruct;
@@ -375,7 +375,7 @@ mod tests {
375 check_assist( 375 check_assist(
376 qualify_path, 376 qualify_path,
377 r" 377 r"
378 test_function<|> 378 test_function$0
379 379
380 pub mod PubMod { 380 pub mod PubMod {
381 pub fn test_function() {}; 381 pub fn test_function() {};
@@ -404,7 +404,7 @@ macro_rules! foo {
404 404
405//- /main.rs crate:main deps:crate_with_macro 405//- /main.rs crate:main deps:crate_with_macro
406fn main() { 406fn main() {
407 foo<|> 407 foo$0
408} 408}
409", 409",
410 r" 410 r"
@@ -421,7 +421,7 @@ fn main() {
421 qualify_path, 421 qualify_path,
422 r" 422 r"
423 struct AssistInfo { 423 struct AssistInfo {
424 group_label: Option<<|>GroupLabel>, 424 group_label: Option<$0GroupLabel>,
425 } 425 }
426 426
427 mod m { pub struct GroupLabel; } 427 mod m { pub struct GroupLabel; }
@@ -445,7 +445,7 @@ fn main() {
445 445
446 use mod1::mod2; 446 use mod1::mod2;
447 fn main() { 447 fn main() {
448 mod2::mod3::TestStruct<|> 448 mod2::mod3::TestStruct$0
449 } 449 }
450 ", 450 ",
451 ); 451 );
@@ -462,7 +462,7 @@ fn main() {
462 462
463 use test_mod::test_function; 463 use test_mod::test_function;
464 fn main() { 464 fn main() {
465 test_function<|> 465 test_function$0
466 } 466 }
467 ", 467 ",
468 ); 468 );
@@ -481,7 +481,7 @@ fn main() {
481 } 481 }
482 482
483 fn main() { 483 fn main() {
484 TestStruct::test_function<|> 484 TestStruct::test_function$0
485 } 485 }
486 ", 486 ",
487 r" 487 r"
@@ -513,7 +513,7 @@ fn main() {
513 } 513 }
514 514
515 fn main() { 515 fn main() {
516 TestStruct::TEST_CONST<|> 516 TestStruct::TEST_CONST$0
517 } 517 }
518 ", 518 ",
519 r" 519 r"
@@ -547,7 +547,7 @@ fn main() {
547 } 547 }
548 548
549 fn main() { 549 fn main() {
550 test_mod::TestStruct::test_function<|> 550 test_mod::TestStruct::test_function$0
551 } 551 }
552 ", 552 ",
553 r" 553 r"
@@ -594,7 +594,7 @@ fn main() {
594 594
595 use test_mod::TestTrait2; 595 use test_mod::TestTrait2;
596 fn main() { 596 fn main() {
597 test_mod::TestEnum::test_function<|>; 597 test_mod::TestEnum::test_function$0;
598 } 598 }
599 ", 599 ",
600 ) 600 )
@@ -617,7 +617,7 @@ fn main() {
617 } 617 }
618 618
619 fn main() { 619 fn main() {
620 test_mod::TestStruct::TEST_CONST<|> 620 test_mod::TestStruct::TEST_CONST$0
621 } 621 }
622 ", 622 ",
623 r" 623 r"
@@ -664,7 +664,7 @@ fn main() {
664 664
665 use test_mod::TestTrait2; 665 use test_mod::TestTrait2;
666 fn main() { 666 fn main() {
667 test_mod::TestEnum::TEST_CONST<|>; 667 test_mod::TestEnum::TEST_CONST$0;
668 } 668 }
669 ", 669 ",
670 ) 670 )
@@ -688,7 +688,7 @@ fn main() {
688 688
689 fn main() { 689 fn main() {
690 let test_struct = test_mod::TestStruct {}; 690 let test_struct = test_mod::TestStruct {};
691 test_struct.test_meth<|>od() 691 test_struct.test_meth$0od()
692 } 692 }
693 ", 693 ",
694 r" 694 r"
@@ -727,7 +727,7 @@ fn main() {
727 727
728 fn main() { 728 fn main() {
729 let test_struct = test_mod::TestStruct {}; 729 let test_struct = test_mod::TestStruct {};
730 test_struct.test_meth<|>od(42) 730 test_struct.test_meth$0od(42)
731 } 731 }
732 ", 732 ",
733 r" 733 r"
@@ -766,7 +766,7 @@ fn main() {
766 766
767 fn main() { 767 fn main() {
768 let test_struct = test_mod::TestStruct {}; 768 let test_struct = test_mod::TestStruct {};
769 test_struct.test_meth<|>od() 769 test_struct.test_meth$0od()
770 } 770 }
771 ", 771 ",
772 r" 772 r"
@@ -796,7 +796,7 @@ fn main() {
796 //- /main.rs crate:main deps:dep 796 //- /main.rs crate:main deps:dep
797 fn main() { 797 fn main() {
798 let test_struct = dep::test_mod::TestStruct {}; 798 let test_struct = dep::test_mod::TestStruct {};
799 test_struct.test_meth<|>od() 799 test_struct.test_meth$0od()
800 } 800 }
801 //- /dep.rs crate:dep 801 //- /dep.rs crate:dep
802 pub mod test_mod { 802 pub mod test_mod {
@@ -825,7 +825,7 @@ fn main() {
825 r" 825 r"
826 //- /main.rs crate:main deps:dep 826 //- /main.rs crate:main deps:dep
827 fn main() { 827 fn main() {
828 dep::test_mod::TestStruct::test_func<|>tion 828 dep::test_mod::TestStruct::test_func$0tion
829 } 829 }
830 //- /dep.rs crate:dep 830 //- /dep.rs crate:dep
831 pub mod test_mod { 831 pub mod test_mod {
@@ -853,7 +853,7 @@ fn main() {
853 r" 853 r"
854 //- /main.rs crate:main deps:dep 854 //- /main.rs crate:main deps:dep
855 fn main() { 855 fn main() {
856 dep::test_mod::TestStruct::CONST<|> 856 dep::test_mod::TestStruct::CONST$0
857 } 857 }
858 //- /dep.rs crate:dep 858 //- /dep.rs crate:dep
859 pub mod test_mod { 859 pub mod test_mod {
@@ -882,7 +882,7 @@ fn main() {
882 //- /main.rs crate:main deps:dep 882 //- /main.rs crate:main deps:dep
883 fn main() { 883 fn main() {
884 let test_struct = dep::test_mod::TestStruct {}; 884 let test_struct = dep::test_mod::TestStruct {};
885 test_struct.test_func<|>tion() 885 test_struct.test_func$0tion()
886 } 886 }
887 //- /dep.rs crate:dep 887 //- /dep.rs crate:dep
888 pub mod test_mod { 888 pub mod test_mod {
@@ -906,7 +906,7 @@ fn main() {
906 //- /main.rs crate:main deps:dep 906 //- /main.rs crate:main deps:dep
907 fn main() { 907 fn main() {
908 let test_struct = dep::test_mod::TestStruct {}; 908 let test_struct = dep::test_mod::TestStruct {};
909 test_struct.test_meth<|>od() 909 test_struct.test_meth$0od()
910 } 910 }
911 //- /dep.rs crate:dep 911 //- /dep.rs crate:dep
912 pub mod test_mod { 912 pub mod test_mod {
@@ -949,7 +949,7 @@ fn main() {
949 use test_mod::TestTrait2; 949 use test_mod::TestTrait2;
950 fn main() { 950 fn main() {
951 let one = test_mod::TestEnum::One; 951 let one = test_mod::TestEnum::One;
952 one.test<|>_method(); 952 one.test$0_method();
953 } 953 }
954 ", 954 ",
955 ) 955 )
@@ -965,7 +965,7 @@ pub struct Struct;
965 965
966//- /main.rs crate:main deps:dep 966//- /main.rs crate:main deps:dep
967fn main() { 967fn main() {
968 Struct<|> 968 Struct$0
969} 969}
970", 970",
971 r" 971 r"
@@ -992,7 +992,7 @@ pub fn panic_fmt() {}
992//- /main.rs crate:main deps:dep 992//- /main.rs crate:main deps:dep
993struct S; 993struct S;
994 994
995impl f<|>mt::Display for S {} 995impl f$0mt::Display for S {}
996", 996",
997 r" 997 r"
998struct S; 998struct S;
@@ -1019,7 +1019,7 @@ mac!();
1019 1019
1020//- /main.rs crate:main deps:dep 1020//- /main.rs crate:main deps:dep
1021fn main() { 1021fn main() {
1022 Cheese<|>; 1022 Cheese$0;
1023} 1023}
1024", 1024",
1025 r" 1025 r"
@@ -1042,7 +1042,7 @@ pub struct fmt;
1042 1042
1043//- /main.rs crate:main deps:dep 1043//- /main.rs crate:main deps:dep
1044fn main() { 1044fn main() {
1045 FMT<|>; 1045 FMT$0;
1046} 1046}
1047", 1047",
1048 r" 1048 r"
@@ -1062,7 +1062,7 @@ fn main() {
1062pub mod generic { pub struct Thing<'a, T>(&'a T); } 1062pub mod generic { pub struct Thing<'a, T>(&'a T); }
1063 1063
1064//- /main.rs crate:main deps:dep 1064//- /main.rs crate:main deps:dep
1065fn foo() -> Thin<|>g<'static, ()> {} 1065fn foo() -> Thin$0g<'static, ()> {}
1066 1066
1067fn main() {} 1067fn main() {}
1068", 1068",
@@ -1083,7 +1083,7 @@ fn main() {}
1083pub mod generic { pub struct Thing<'a, T>(&'a T); } 1083pub mod generic { pub struct Thing<'a, T>(&'a T); }
1084 1084
1085//- /main.rs crate:main deps:dep 1085//- /main.rs crate:main deps:dep
1086fn foo() -> Thin<|>g::<'static, ()> {} 1086fn foo() -> Thin$0g::<'static, ()> {}
1087 1087
1088fn main() {} 1088fn main() {}
1089", 1089",
@@ -1108,7 +1108,7 @@ fn main() {}
1108 } 1108 }
1109 1109
1110 fn main() { 1110 fn main() {
1111 TestStruct::<()>::TEST_CONST<|> 1111 TestStruct::<()>::TEST_CONST$0
1112 } 1112 }
1113 ", 1113 ",
1114 r" 1114 r"
@@ -1142,7 +1142,7 @@ fn main() {}
1142 } 1142 }
1143 1143
1144 fn main() { 1144 fn main() {
1145 test_mod::TestStruct::<()>::TEST_CONST<|> 1145 test_mod::TestStruct::<()>::TEST_CONST$0
1146 } 1146 }
1147 ", 1147 ",
1148 r" 1148 r"
@@ -1180,7 +1180,7 @@ fn main() {}
1180 1180
1181 fn main() { 1181 fn main() {
1182 let test_struct = test_mod::TestStruct {}; 1182 let test_struct = test_mod::TestStruct {};
1183 test_struct.test_meth<|>od::<()>() 1183 test_struct.test_meth$0od::<()>()
1184 } 1184 }
1185 ", 1185 ",
1186 r" 1186 r"