Commit 28f284d
committed
[lldb] Rewrite Swift REPL completion to use CompletionRequest
This removes all the workaround and problematic code that was needed
for the old interface. With the CompletionRequest we no longer need
to calculate the common prefix ourselves and we don't need to calculate
the magic return value. On the other hand we can no longer provide
'appendix' completions (E.g. completing "Suff" with "ix", instead
we now need to provide the completion "Suffix"), so in one case
we now need to prefix the completion with the existing prefix from
the CompletionRequest (as Swift only returns the string to append
and not the whole token).
Also rewrites the TestSwiftREPLCompletion.py to test all the
problematic cases and some more.1 parent b8ea404 commit 28f284d
File tree
3 files changed
+64
-42
lines changed- lldb
- packages/Python/lldbsuite/test/lang/swift/completion
- source/Plugins/ExpressionParser/Swift
3 files changed
+64
-42
lines changedLines changed: 34 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
4 | 2 | | |
5 | 3 | | |
6 | 4 | | |
7 | | - | |
| 5 | + | |
8 | 6 | | |
| 7 | + | |
9 | 8 | | |
10 | | - | |
11 | 9 | | |
12 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
13 | 14 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
Lines changed: 28 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
536 | | - | |
537 | | - | |
| 536 | + | |
| 537 | + | |
538 | 538 | | |
539 | 539 | | |
540 | 540 | | |
| |||
546 | 546 | | |
547 | 547 | | |
548 | 548 | | |
549 | | - | |
| 549 | + | |
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
| |||
579 | 579 | | |
580 | 580 | | |
581 | 581 | | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
582 | 587 | | |
583 | 588 | | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
584 | 592 | | |
585 | 593 | | |
586 | | - | |
587 | | - | |
| 594 | + | |
| 595 | + | |
588 | 596 | | |
| 597 | + | |
589 | 598 | | |
590 | 599 | | |
591 | 600 | | |
592 | 601 | | |
593 | | - | |
594 | | - | |
595 | | - | |
| 602 | + | |
596 | 603 | | |
597 | 604 | | |
598 | 605 | | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
599 | 611 | | |
600 | | - | |
| 612 | + | |
601 | 613 | | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | 614 | | |
613 | 615 | | |
614 | 616 | | |
615 | 617 | | |
616 | | - | |
617 | | - | |
| 618 | + | |
618 | 619 | | |
619 | 620 | | |
620 | 621 | | |
621 | | - | |
622 | | - | |
623 | | - | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
624 | 628 | | |
625 | 629 | | |
626 | 630 | | |
627 | 631 | | |
628 | 632 | | |
629 | 633 | | |
630 | | - | |
631 | | - | |
632 | 634 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
| 71 | + | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
0 commit comments