-
Notifications
You must be signed in to change notification settings - Fork 439
Move TokenSyntax to SyntaxNodes.swift.gyb #163
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
All the other syntax nodes live in SyntaxNodes.swift.gyb, we should not make an exception for TokenSyntax
@swift-ci Please test |
From a discoverability point of view, might it not be better if types that are entirely non-generated stay in separate files instead of being lumped in with the generated content? (Unless they need Especially considering how large the SyntaxNodes.swift file already is... |
It’s only affecting |
I dunno, I think I'd prefer going the other direction, moving UnknownSyntax to its own file. I don't see a benefit for moving TokenSyntax... |
The issue came up because I was looking through code in the generated I think it makes sense to have all node declarations in one file if you think that we are shipping the generated files as a SwiftPM dependency. Whoever depends on SwiftSyntax should not have to worry about why some nodes were generated and others weren’t. I think it’s conceptually easier if you can tell someone that all syntax nodes are declared in |
I'm leaning with with @allevato and @harlanhaskins, I prefer that we only put in gyb files what needs to be generated, and move to normal Swift files what does not need gyb to be written out. |
Yeah, I probably would have moved IMO, it feels a little odd to have large units of code that doesn't change via generation in a generator file when the language doesn't require that organization. In my own experience, it's helpful to keep the generated surface as small as possible, because at a minimum, if you're editing/viewing a
The times that I've had to jump into SyntaxNodes.swift (the generated one) to look something up on a particular node type, its size sometimes gets in the way. So what you say above makes sense and leads to a question I was going to ask for a different reason: The |
I don’t have too strong feelings about this as well. I just felt like the status quo is definitely not optimal.
That’s an interesting thought. We may be able to drive |
Thanks for your feedback. I am now pursuing splitting Closing this PR. |
Update to Swift 5.2 release.
All the other syntax nodes live in
SyntaxNodes.swift.gyb
, we should not make an exception forTokenSyntax
.