diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-06-24 10:34:25 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-24 10:34:25 +0100 |
commit | 7c28d060b5a5c4e7004282aa6827c3023c5b03c8 (patch) | |
tree | 0ed66d422a10a9f192a039565ac70b85dbdf80f8 /crates/ra_ide/src/completion/complete_dot.rs | |
parent | 15c71f881607db5ddfd759785f62e4ae44aaf301 (diff) | |
parent | c749fe223bf5a41709a4bc91d0f56dafc4201658 (diff) |
Merge #5021
5021: Reduce code dupication around fixtures r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/completion/complete_dot.rs')
-rw-r--r-- | crates/ra_ide/src/completion/complete_dot.rs | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/crates/ra_ide/src/completion/complete_dot.rs b/crates/ra_ide/src/completion/complete_dot.rs index 05f825c6f..ee4e24fca 100644 --- a/crates/ra_ide/src/completion/complete_dot.rs +++ b/crates/ra_ide/src/completion/complete_dot.rs | |||
@@ -94,8 +94,8 @@ mod tests { | |||
94 | [ | 94 | [ |
95 | CompletionItem { | 95 | CompletionItem { |
96 | label: "the_field", | 96 | label: "the_field", |
97 | source_range: 94..94, | 97 | source_range: 45..45, |
98 | delete: 94..94, | 98 | delete: 45..45, |
99 | insert: "the_field", | 99 | insert: "the_field", |
100 | kind: Field, | 100 | kind: Field, |
101 | detail: "u32", | 101 | detail: "u32", |
@@ -125,8 +125,8 @@ mod tests { | |||
125 | [ | 125 | [ |
126 | CompletionItem { | 126 | CompletionItem { |
127 | label: "foo()", | 127 | label: "foo()", |
128 | source_range: 187..187, | 128 | source_range: 102..102, |
129 | delete: 187..187, | 129 | delete: 102..102, |
130 | insert: "foo()$0", | 130 | insert: "foo()$0", |
131 | kind: Method, | 131 | kind: Method, |
132 | lookup: "foo", | 132 | lookup: "foo", |
@@ -134,8 +134,8 @@ mod tests { | |||
134 | }, | 134 | }, |
135 | CompletionItem { | 135 | CompletionItem { |
136 | label: "the_field", | 136 | label: "the_field", |
137 | source_range: 187..187, | 137 | source_range: 102..102, |
138 | delete: 187..187, | 138 | delete: 102..102, |
139 | insert: "the_field", | 139 | insert: "the_field", |
140 | kind: Field, | 140 | kind: Field, |
141 | detail: "(u32,)", | 141 | detail: "(u32,)", |
@@ -165,8 +165,8 @@ mod tests { | |||
165 | [ | 165 | [ |
166 | CompletionItem { | 166 | CompletionItem { |
167 | label: "foo()", | 167 | label: "foo()", |
168 | source_range: 126..126, | 168 | source_range: 77..77, |
169 | delete: 126..126, | 169 | delete: 77..77, |
170 | insert: "foo()$0", | 170 | insert: "foo()$0", |
171 | kind: Method, | 171 | kind: Method, |
172 | lookup: "foo", | 172 | lookup: "foo", |
@@ -174,8 +174,8 @@ mod tests { | |||
174 | }, | 174 | }, |
175 | CompletionItem { | 175 | CompletionItem { |
176 | label: "the_field", | 176 | label: "the_field", |
177 | source_range: 126..126, | 177 | source_range: 77..77, |
178 | delete: 126..126, | 178 | delete: 77..77, |
179 | insert: "the_field", | 179 | insert: "the_field", |
180 | kind: Field, | 180 | kind: Field, |
181 | detail: "(u32, i32)", | 181 | detail: "(u32, i32)", |
@@ -222,24 +222,24 @@ mod tests { | |||
222 | [ | 222 | [ |
223 | CompletionItem { | 223 | CompletionItem { |
224 | label: "crate_field", | 224 | label: "crate_field", |
225 | source_range: 313..313, | 225 | source_range: 192..192, |
226 | delete: 313..313, | 226 | delete: 192..192, |
227 | insert: "crate_field", | 227 | insert: "crate_field", |
228 | kind: Field, | 228 | kind: Field, |
229 | detail: "u32", | 229 | detail: "u32", |
230 | }, | 230 | }, |
231 | CompletionItem { | 231 | CompletionItem { |
232 | label: "pub_field", | 232 | label: "pub_field", |
233 | source_range: 313..313, | 233 | source_range: 192..192, |
234 | delete: 313..313, | 234 | delete: 192..192, |
235 | insert: "pub_field", | 235 | insert: "pub_field", |
236 | kind: Field, | 236 | kind: Field, |
237 | detail: "u32", | 237 | detail: "u32", |
238 | }, | 238 | }, |
239 | CompletionItem { | 239 | CompletionItem { |
240 | label: "super_field", | 240 | label: "super_field", |
241 | source_range: 313..313, | 241 | source_range: 192..192, |
242 | delete: 313..313, | 242 | delete: 192..192, |
243 | insert: "super_field", | 243 | insert: "super_field", |
244 | kind: Field, | 244 | kind: Field, |
245 | detail: "u32", | 245 | detail: "u32", |
@@ -268,16 +268,16 @@ mod tests { | |||
268 | [ | 268 | [ |
269 | CompletionItem { | 269 | CompletionItem { |
270 | label: "field", | 270 | label: "field", |
271 | source_range: 140..140, | 271 | source_range: 67..67, |
272 | delete: 140..140, | 272 | delete: 67..67, |
273 | insert: "field", | 273 | insert: "field", |
274 | kind: Field, | 274 | kind: Field, |
275 | detail: "u8", | 275 | detail: "u8", |
276 | }, | 276 | }, |
277 | CompletionItem { | 277 | CompletionItem { |
278 | label: "other", | 278 | label: "other", |
279 | source_range: 140..140, | 279 | source_range: 67..67, |
280 | delete: 140..140, | 280 | delete: 67..67, |
281 | insert: "other", | 281 | insert: "other", |
282 | kind: Field, | 282 | kind: Field, |
283 | detail: "u16", | 283 | detail: "u16", |
@@ -305,8 +305,8 @@ mod tests { | |||
305 | [ | 305 | [ |
306 | CompletionItem { | 306 | CompletionItem { |
307 | label: "the_method()", | 307 | label: "the_method()", |
308 | source_range: 144..144, | 308 | source_range: 71..71, |
309 | delete: 144..144, | 309 | delete: 71..71, |
310 | insert: "the_method()$0", | 310 | insert: "the_method()$0", |
311 | kind: Method, | 311 | kind: Method, |
312 | lookup: "the_method", | 312 | lookup: "the_method", |
@@ -338,8 +338,8 @@ mod tests { | |||
338 | [ | 338 | [ |
339 | CompletionItem { | 339 | CompletionItem { |
340 | label: "the_method()", | 340 | label: "the_method()", |
341 | source_range: 243..243, | 341 | source_range: 134..134, |
342 | delete: 243..243, | 342 | delete: 134..134, |
343 | insert: "the_method()$0", | 343 | insert: "the_method()$0", |
344 | kind: Method, | 344 | kind: Method, |
345 | lookup: "the_method", | 345 | lookup: "the_method", |
@@ -371,8 +371,8 @@ mod tests { | |||
371 | [ | 371 | [ |
372 | CompletionItem { | 372 | CompletionItem { |
373 | label: "the_method()", | 373 | label: "the_method()", |
374 | source_range: 256..256, | 374 | source_range: 147..147, |
375 | delete: 256..256, | 375 | delete: 147..147, |
376 | insert: "the_method()$0", | 376 | insert: "the_method()$0", |
377 | kind: Method, | 377 | kind: Method, |
378 | lookup: "the_method", | 378 | lookup: "the_method", |
@@ -400,8 +400,8 @@ mod tests { | |||
400 | [ | 400 | [ |
401 | CompletionItem { | 401 | CompletionItem { |
402 | label: "the_method()", | 402 | label: "the_method()", |
403 | source_range: 151..151, | 403 | source_range: 90..90, |
404 | delete: 151..151, | 404 | delete: 90..90, |
405 | insert: "the_method()$0", | 405 | insert: "the_method()$0", |
406 | kind: Method, | 406 | kind: Method, |
407 | lookup: "the_method", | 407 | lookup: "the_method", |
@@ -429,8 +429,8 @@ mod tests { | |||
429 | [ | 429 | [ |
430 | CompletionItem { | 430 | CompletionItem { |
431 | label: "the_method()", | 431 | label: "the_method()", |
432 | source_range: 155..155, | 432 | source_range: 94..94, |
433 | delete: 155..155, | 433 | delete: 94..94, |
434 | insert: "the_method()$0", | 434 | insert: "the_method()$0", |
435 | kind: Method, | 435 | kind: Method, |
436 | lookup: "the_method", | 436 | lookup: "the_method", |
@@ -461,8 +461,8 @@ mod tests { | |||
461 | [ | 461 | [ |
462 | CompletionItem { | 462 | CompletionItem { |
463 | label: "the_method()", | 463 | label: "the_method()", |
464 | source_range: 219..219, | 464 | source_range: 122..122, |
465 | delete: 219..219, | 465 | delete: 122..122, |
466 | insert: "the_method()$0", | 466 | insert: "the_method()$0", |
467 | kind: Method, | 467 | kind: Method, |
468 | lookup: "the_method", | 468 | lookup: "the_method", |
@@ -513,8 +513,8 @@ mod tests { | |||
513 | [ | 513 | [ |
514 | CompletionItem { | 514 | CompletionItem { |
515 | label: "the_method()", | 515 | label: "the_method()", |
516 | source_range: 249..249, | 516 | source_range: 128..128, |
517 | delete: 249..249, | 517 | delete: 128..128, |
518 | insert: "the_method()$0", | 518 | insert: "the_method()$0", |
519 | kind: Method, | 519 | kind: Method, |
520 | lookup: "the_method", | 520 | lookup: "the_method", |
@@ -540,16 +540,16 @@ mod tests { | |||
540 | [ | 540 | [ |
541 | CompletionItem { | 541 | CompletionItem { |
542 | label: "0", | 542 | label: "0", |
543 | source_range: 75..75, | 543 | source_range: 38..38, |
544 | delete: 75..75, | 544 | delete: 38..38, |
545 | insert: "0", | 545 | insert: "0", |
546 | kind: Field, | 546 | kind: Field, |
547 | detail: "i32", | 547 | detail: "i32", |
548 | }, | 548 | }, |
549 | CompletionItem { | 549 | CompletionItem { |
550 | label: "1", | 550 | label: "1", |
551 | source_range: 75..75, | 551 | source_range: 38..38, |
552 | delete: 75..75, | 552 | delete: 38..38, |
553 | insert: "1", | 553 | insert: "1", |
554 | kind: Field, | 554 | kind: Field, |
555 | detail: "f64", | 555 | detail: "f64", |
@@ -583,8 +583,8 @@ mod tests { | |||
583 | [ | 583 | [ |
584 | CompletionItem { | 584 | CompletionItem { |
585 | label: "blah()", | 585 | label: "blah()", |
586 | source_range: 299..300, | 586 | source_range: 190..191, |
587 | delete: 299..300, | 587 | delete: 190..191, |
588 | insert: "blah()$0", | 588 | insert: "blah()$0", |
589 | kind: Method, | 589 | kind: Method, |
590 | lookup: "blah", | 590 | lookup: "blah", |
@@ -610,8 +610,8 @@ mod tests { | |||
610 | [ | 610 | [ |
611 | CompletionItem { | 611 | CompletionItem { |
612 | label: "the_field", | 612 | label: "the_field", |
613 | source_range: 106..106, | 613 | source_range: 69..69, |
614 | delete: 106..106, | 614 | delete: 69..69, |
615 | insert: "the_field", | 615 | insert: "the_field", |
616 | kind: Field, | 616 | kind: Field, |
617 | detail: "u32", | 617 | detail: "u32", |
@@ -676,15 +676,15 @@ mod tests { | |||
676 | [ | 676 | [ |
677 | CompletionItem { | 677 | CompletionItem { |
678 | label: "A", | 678 | label: "A", |
679 | source_range: 217..217, | 679 | source_range: 120..120, |
680 | delete: 217..217, | 680 | delete: 120..120, |
681 | insert: "A", | 681 | insert: "A", |
682 | kind: Const, | 682 | kind: Const, |
683 | }, | 683 | }, |
684 | CompletionItem { | 684 | CompletionItem { |
685 | label: "b", | 685 | label: "b", |
686 | source_range: 217..217, | 686 | source_range: 120..120, |
687 | delete: 217..217, | 687 | delete: 120..120, |
688 | insert: "b", | 688 | insert: "b", |
689 | kind: Module, | 689 | kind: Module, |
690 | }, | 690 | }, |
@@ -709,8 +709,8 @@ mod tests { | |||
709 | [ | 709 | [ |
710 | CompletionItem { | 710 | CompletionItem { |
711 | label: "the_field", | 711 | label: "the_field", |
712 | source_range: 156..157, | 712 | source_range: 91..92, |
713 | delete: 156..157, | 713 | delete: 91..92, |
714 | insert: "the_field", | 714 | insert: "the_field", |
715 | kind: Field, | 715 | kind: Field, |
716 | detail: "u32", | 716 | detail: "u32", |
@@ -736,8 +736,8 @@ mod tests { | |||
736 | [ | 736 | [ |
737 | CompletionItem { | 737 | CompletionItem { |
738 | label: "the_field", | 738 | label: "the_field", |
739 | source_range: 156..157, | 739 | source_range: 91..92, |
740 | delete: 156..157, | 740 | delete: 91..92, |
741 | insert: "the_field", | 741 | insert: "the_field", |
742 | kind: Field, | 742 | kind: Field, |
743 | detail: "u32", | 743 | detail: "u32", |
@@ -764,8 +764,8 @@ mod tests { | |||
764 | [ | 764 | [ |
765 | CompletionItem { | 765 | CompletionItem { |
766 | label: "the_field", | 766 | label: "the_field", |
767 | source_range: 156..156, | 767 | source_range: 91..91, |
768 | delete: 156..156, | 768 | delete: 91..91, |
769 | insert: "the_field", | 769 | insert: "the_field", |
770 | kind: Field, | 770 | kind: Field, |
771 | detail: "u32", | 771 | detail: "u32", |
@@ -791,8 +791,8 @@ mod tests { | |||
791 | [ | 791 | [ |
792 | CompletionItem { | 792 | CompletionItem { |
793 | label: "the_field", | 793 | label: "the_field", |
794 | source_range: 162..163, | 794 | source_range: 97..98, |
795 | delete: 162..163, | 795 | delete: 97..98, |
796 | insert: "the_field", | 796 | insert: "the_field", |
797 | kind: Field, | 797 | kind: Field, |
798 | detail: "u32", | 798 | detail: "u32", |
@@ -828,8 +828,8 @@ mod tests { | |||
828 | [ | 828 | [ |
829 | CompletionItem { | 829 | CompletionItem { |
830 | label: "the_field", | 830 | label: "the_field", |
831 | source_range: 552..552, | 831 | source_range: 327..327, |
832 | delete: 552..552, | 832 | delete: 327..327, |
833 | insert: "the_field", | 833 | insert: "the_field", |
834 | kind: Field, | 834 | kind: Field, |
835 | detail: "u32", | 835 | detail: "u32", |
@@ -858,8 +858,8 @@ mod tests { | |||
858 | [ | 858 | [ |
859 | CompletionItem { | 859 | CompletionItem { |
860 | label: "the_method()", | 860 | label: "the_method()", |
861 | source_range: 201..201, | 861 | source_range: 116..116, |
862 | delete: 201..201, | 862 | delete: 116..116, |
863 | insert: "the_method()$0", | 863 | insert: "the_method()$0", |
864 | kind: Method, | 864 | kind: Method, |
865 | lookup: "the_method", | 865 | lookup: "the_method", |