-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[ASTGen] Make ASTGenVisitor not conform to SyntaxTransformVisitor #68574
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
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 fairly good to me. I just have one suggestion of how you can avoid the Syntax
, ie. the places where you currently need to call the Syntax
initializer.
A couple of other things that should be part of this PR:
- You should be able to remove
visitAny
in ASTGen.swift:98 now visit(_: SourceFileSyntax) -> ASTNode
in ASTGen.swift:94 also isn’t needed anymore- The uncommented method
visit(_: T?) -> [UnsafeMutableRawPointer]?
in ASTGen.swift:88 is outdated, not used, and can be removed` - There are still a few
visit
methods inASTGen
that should be renamed togenerate
. Searching forfunc visit
shouldn’t give any results in ASTGen anymore.
I rebuilt all the test dependencies and ran all the test with this command
I had an error with the Any tips when making code changes and having to update/write tests? There are lots of moving pieces and the repo is very big but I want to grasp how testing works and where I would need to make updates anytime I make a change. |
What I usually do, is opening the test files in a separate text editor that’s not Xcode. Alternatively, you can also navigate to |
When would I know if it is appropriate to updates/add tests? For this issue, do we not need to do any testing because it is just updating function calls/names? |
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.
One formatting comment, otherwise LGTM.
@swift-ci Please smoke test |
CI failed with
Could you debug the failure? |
This is a weird issue because all I did was add new lines between the functions and it broke the CI. I just pushed up changes to resolve merge conflicts and updated the branch completely. Maybe that is the fix? |
Unlikely. You've made quite a few changes, including entirely rewriting the function that contains the tripping fatal error. According to the stacktrace, you're fatal erroring in You'll need to figure out what cases you're missing and either figure out why you're hitting them if they're not supposed to be hit, or implement them. |
@ahoppen could you run the tests please? |
@swift-ci please test |
@swift-ci Please test Linux |
@swift-ci please test Linux |
@swift-ci Please test Linux |
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.
Sorry to chime in so late!
|
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.
Just a couple more remarks. Once resolved, please clean up the commit history, and we’ll be ready to go for merge.
How'd it go? Need help? |
It went alright, I think. I cleaned up past commits but I don't think it was 100% right. After I ran
I then force pushed to the PR and it did remove all the extra commits I wanted gone. But then, it added all past commits from others (which is why it added them as reviewers), and I simply did the same thing but changed commits to |
You can just run
It's not clear to me how this could have happened, did you do any re-ordering of commits in the rebase? |
I did not do any reordering of commits in the rebase. Should I cleanup the 3 commits or is what I have fine? |
Squashing them would be appreciated 🙇♂️ |
After squashing and getting rid of the merge commit, please consider breaking up your changes into at least 2 meaningful commits rather than cramming everything into a single one. For example, the first one removes the conformance, and the second renames the methods. |
5641ae2
to
b28bad5
Compare
b28bad5
to
d836a23
Compare
I think it's fine in this case, it's fairly self contained as is. |
@swift-ci please test |
That should definitely be a separate PR, is there any reason you added it to this one? |
@bnbarham I just pushed up one last commit. It should be good to go now. |
I saw, see my above comment. I'd prefer that one in a new PR. |
I added this commit to keep things in line with |
1584f32
to
22fe6d9
Compare
Ok @bnbarham I got the rebase working correctly and now there is only one commit 😎 |
I don’t mind as much, but would love a more descriptive commit message, like the title of the issue. |
I don't mind updating it |
Sure, all for a more descriptive title and description in the commit :) |
22fe6d9
to
a4da276
Compare
@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.
Thanks!
ASTGenVisitor
toSyntaxTransformVisitor
.visit(Syntax)
method similar toSytnaxTransformVisitor.visit(Syntax)
but that only handles the correct nodes inASTGen
.visit
methods togenerate
.Resolves #68350