-
Notifications
You must be signed in to change notification settings - Fork 439
Audit the public API of the SwiftSyntax module #1482
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
ahoppen
merged 12 commits into
swiftlang:main
from
ahoppen:ahoppen/swiftsyntax-public-api
Apr 11, 2023
Merged
Audit the public API of the SwiftSyntax module #1482
ahoppen
merged 12 commits into
swiftlang:main
from
ahoppen:ahoppen/swiftsyntax-public-api
Apr 11, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@swift-ci Please test |
a4889ed
to
aecc4f4
Compare
@swift-ci Please test |
This was referenced Apr 5, 2023
aecc4f4
to
5519653
Compare
5519653
to
19cc276
Compare
swiftlang/swift#64954 @swift-ci Please test Windows |
These names never belonged in `SwiftSyntax`. It was just most convenient to put them there. Move them to `SwiftParserDiagnostics` so we can mark them as `internal`.
This allows us to make the properties internal and remove them from the public API surface.
Nobody loves files whose best description is “miscellaneous”.
I has been a bit incosistent that something named `Raw` was part of SwiftSyntax’s public API. Put it behind `RawSyntax` SPI for now. If we want to make it public again, we should rename it to something that doesn’t contain `Raw`
These getters were redundant with other ways to check the properties.
Clients should never need to worry about a node’s index within the parent, especially because `indexInParent` will return the index while also including `nil` nodes and that’s a view of the tree you cannot get anywhere.
I know that it’s really verbose but I would like to be explicit about the view mode be explicit about the view mode because different clients will have different needs and we shouldn’t be assuming that one of the view modes is superior to the other.
`with(\.tokenKind, newValue)` should be used instead.
19cc276
to
84358d0
Compare
swiftlang/swift#64954 @swift-ci Please test Windows |
ahoppen
added a commit
to ahoppen/swift-syntax
that referenced
this pull request
Apr 18, 2023
…blic-api Audit the public API of the SwiftSyntax module
ahoppen
added a commit
to ahoppen/swift-syntax
that referenced
this pull request
Apr 18, 2023
…blic-api Audit the public API of the SwiftSyntax module
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a collection of quite a few independent commits that all have one goal: Not making any functions that we don’t want to support long-term public in
SwiftSyntax
. While doing this, I was able to move a few things fromSwiftSyntax
toSwiftParserDiagnostics
. There is no functionality change, and very little refactoring.