Skip to content

Make leading/trailing trivia required fields #1477

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

Merged
merged 1 commit into from
Apr 3, 2023

Conversation

bnbarham
Copy link
Contributor

Rather than having the possibility of nil trivia and requiring all clients to check every use, just return empty trivia when there are no nodes present.

@bnbarham
Copy link
Contributor Author

@swift-ci please test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes please, this is a nice cleanup!

@bnbarham
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@kimdv kimdv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 🥳

bnbarham added a commit to bnbarham/swift that referenced this pull request Mar 31, 2023
swiftlang/swift-syntax#1477 makes `leadingTrivia`
and `trailingTrivia` non-optional.
@bnbarham
Copy link
Contributor Author

swiftlang/swift#64814

@swift-ci please test

bnbarham added a commit to bnbarham/swift that referenced this pull request Mar 31, 2023
swiftlang/swift-syntax#1477 makes `leadingTrivia`
and `trailingTrivia` non-optional.
Rather than having the possibility of `nil` trivia and requiring all
clients to check every use, just return empty trivia when there are no
nodes present.
@bnbarham
Copy link
Contributor Author

bnbarham commented Apr 2, 2023

@bnbarham bnbarham merged commit cb3f64d into swiftlang:main Apr 3, 2023
@bnbarham bnbarham deleted the empty-trivia branch April 3, 2023 16:17
bnbarham added a commit to bnbarham/swift that referenced this pull request Apr 3, 2023
swiftlang/swift-syntax#1477 makes `leadingTrivia`
and `trailingTrivia` non-optional.

(cherry picked from commit 2ad8db4)
kishikawakatsumi added a commit to kishikawakatsumi/swift-power-assert that referenced this pull request Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants