Skip to content

Prevent rename of argument labels for enum cases #1229

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
May 7, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented May 7, 2024

Renaming an enum case currently caused invalid code to be generated because we would rename eg. myCase(String) to myNewCase(_ String).

Fixing the underlying issue requires changes to sourcekitd, that are out-of-scope at the moment. For now, just suppress argument label rename for enum cases in SourceKit-LSP and avoid generating invalid code even if just the base name is modified.

rdar://127248157

Renaming an enum case currently caused invalid code to be generated because we would rename eg. `myCase(String)` to `myNewCase(_ String)`.

Fixing the underlying issue requires changes to `sourcekitd`, that are out-of-scope at the moment. For now, just suppress argument label rename for enum cases in SourceKit-LSP and avoid generating invalid code even if just the base name is modified.

rdar://127248157
@ahoppen ahoppen requested a review from bnbarham May 7, 2024 00:07
@ahoppen ahoppen requested a review from benlangmuir as a code owner May 7, 2024 00:07
@ahoppen
Copy link
Member Author

ahoppen commented May 7, 2024

@swift-ci Please test Windows

@ahoppen
Copy link
Member Author

ahoppen commented May 7, 2024

@swift-ci Please test

@ahoppen ahoppen merged commit 60c8391 into swiftlang:main May 7, 2024
3 checks passed
@ahoppen ahoppen deleted the fix-enum-case-rename-issue branch May 7, 2024 16:00
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.

2 participants