-
Notifications
You must be signed in to change notification settings - Fork 441
Pretty results of dump() for Syntax #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@swift-ci Please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!!! I love this change, and I think you've taken the best approach with it.
Could you add a few tests to test the full output of a Syntax node against the expected string? The test to make sure all children are custom reflectable is great!
I'm working for necessary tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thank you for adding those tests!
@swift-ci please test |
Build failed |
@Kuniwak Thank you for your patience. Could you resolve the conflict? |
I'm reading the diff for resolving the conflict. |
The result of dump() with Syntax is not useful. For example, the dumped result of Tests/SwiftSyntaxTest/Inputs/closure.swift is the following: ``` ▿ // A closure without a signature. The test will ensure it stays the same after // applying a rewriting pass. let x: () -> Void = {} ▿ data: SwiftSyntax.SyntaxData - parent: nil ▿ absoluteRaw: SwiftSyntax.AbsoluteRawSyntax - raw: // A closure without a signature. The test will ensure it stays the same after // applying a rewriting pass. let x: () -> Void = {} #0 ▿ super: Swift.ManagedBuffer<SwiftSyntax.RawSyntaxBase, Swift.UInt64> ▿ header: SwiftSyntax.RawSyntaxBase ... ``` This patch improve this result to the following: ``` ▿ SourceFileSyntax ▿ statements: CodeBlockItemListSyntax ▿ CodeBlockItemSyntax ▿ item: VariableDeclSyntax - attributes: nil - modifiers: nil ▿ letOrVarKeyword: TokenSyntax - text: "let" ▿ leadingTrivia: SwiftSyntax.Trivia ▿ pieces: 4 elements ▿ TriviaPiece - lineComment: "// A closure without a signature. The test will ensure it stays the same after" ... ```
@rintaro I resolved the conflict. |
@swift-ci please test |
Build failed |
Thanks again, @Kuniwak! |
Put freestanding `init` decls in a test into a type.
The result of dump() with Syntax is not useful. For example,
the dumped result of
Tests/SwiftSyntaxTest/Inputs/closure.swift
is the following:This patch improves this result to the following: