Skip to content

[5.9][Rename] Also syntactically rename a macro’s definition #65419

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

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Apr 25, 2023

  • Explanation: Previously we were skipping the macro’s definition (i.e. the part after = in a macro declaration if it wasn’t type checked. Since syntactic rename doesn’t type-check anything, it was thus skipping the macro definition. Add a flag to ASTWalker that allows NameMatcher to opt-out of this behavior.
  • Scope: SourceKit, in particular syntactic rename
  • Risk: Low, only changes behavior for syntactic rename
  • Testing: Added regression test
  • Issue: rdar://108391854
  • Reviewer: @bnbarham on [Rename] Also syntactically rename a macro’s definition #65399

Previously we were skipping the macro’s definition (i.e. the part after `=` in a macro declaration if it wasn’t type checked. Since syntactic rename doesn’t type-check anything, it was thus skippin the macro definition. Add a flag to `ASTWalker` that allows `NameMatcher` to opt-out of this behavior.
@ahoppen ahoppen requested a review from a team as a code owner April 25, 2023 21:39
@ahoppen ahoppen changed the title [Rename] Also syntactically rename a macro’s definition [5.9][Rename] Also syntactically rename a macro’s definition Apr 25, 2023
@ahoppen
Copy link
Member Author

ahoppen commented Apr 25, 2023

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Apr 26, 2023

@swift-ci Please test

@ahoppen ahoppen merged commit d246483 into swiftlang:release/5.9 Apr 26, 2023
@ahoppen ahoppen deleted the ahoppen/5.9/rename-macro-declaration branch April 26, 2023 14:00
@AnthonyLatsis AnthonyLatsis added the 🍒 release cherry pick Flag: Release branch cherry picks label May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants