Commit b9580e4
committed
Improve debug description of syntax nodes
This improves the description generated by the `debugDescription` function to something like the following which is easier to read IMO
```
SourceFileSyntax
├─CodeBlockItemListSyntax
│ ╰─CodeBlockItemSyntax
│ ╰─MacroExpansionExprSyntax
│ ├─pound
│ ├─identifier("stringify")
│ ├─leftParen
│ ├─TupleExprElementListSyntax
│ │ ╰─TupleExprElementSyntax
│ │ ╰─InfixOperatorExprSyntax
│ │ ├─IntegerLiteralExprSyntax
│ │ │ ╰─integerLiteral("2")
│ │ ├─BinaryOperatorExprSyntax
│ │ │ ╰─binaryOperator("+")
│ │ ╰─IntegerLiteralExprSyntax
│ │ ╰─integerLiteral("3")
│ ╰─rightParen
╰─eof
```
Since we now have this nice representation, it also removes the conformances to `CustomReflectable` (deleting 3000 lines of code :hooray:) and doing some new `CustomReflectable` hackery to make the debugger just print `debugDescription` and not try to print the node’s children itself. This way you an now do `po node` in the debugger to get the debug description from above, instead of having to do `e print(node.recursiveDescription)`1 parent ac4f8f3 commit b9580e4
File tree
8 files changed
+16
-3206
lines changed- CodeGeneration/Sources/generate-swiftsyntax/templates/swiftsyntax
- Sources/SwiftSyntax
- generated/syntaxNodes
8 files changed
+16
-3206
lines changedLines changed: 0 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | 283 | | |
305 | 284 | | |
306 | 285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| |||
598 | 598 | | |
599 | 599 | | |
600 | 600 | | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
601 | 607 | | |
602 | 608 | | |
603 | 609 | | |
| |||
615 | 621 | | |
616 | 622 | | |
617 | 623 | | |
618 | | - | |
| 624 | + | |
619 | 625 | | |
620 | 626 | | |
621 | 627 | | |
622 | | - | |
| 628 | + | |
623 | 629 | | |
624 | 630 | | |
625 | 631 | | |
| |||
628 | 634 | | |
629 | 635 | | |
630 | 636 | | |
631 | | - | |
| 637 | + | |
632 | 638 | | |
633 | 639 | | |
634 | 640 | | |
| |||
639 | 645 | | |
640 | 646 | | |
641 | 647 | | |
642 | | - | |
| 648 | + | |
643 | 649 | | |
644 | 650 | | |
645 | 651 | | |
| |||
660 | 666 | | |
661 | 667 | | |
662 | 668 | | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | 669 | | |
669 | 670 | | |
670 | 671 | | |
| |||
680 | 681 | | |
681 | 682 | | |
682 | 683 | | |
683 | | - | |
684 | 684 | | |
| 685 | + | |
685 | 686 | | |
686 | | - | |
687 | | - | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
688 | 690 | | |
689 | 691 | | |
690 | 692 | | |
691 | 693 | | |
692 | 694 | | |
693 | 695 | | |
694 | | - | |
| 696 | + | |
695 | 697 | | |
696 | 698 | | |
697 | 699 | | |
| |||
Lines changed: 0 additions & 481 deletions
Large diffs are not rendered by default.
0 commit comments