Skip to content
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

Fix renaming enum case parameters with unnamed associated arguments #74534

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jun 18, 2024

We treated enum case parameters the same way as function parameters and weren’t considering that they can be unlabeled. That caused us to insert eg. `_ ` in front of the case’s type, producing `case myCase(_ String)`, which is invalid. When we are inside an enum case parameter and the parameter label is empty, treat it the same as a function call, which will leave the label untouched if it isn’t modified and insert a label including a colon if a new label is introduced.

swiftlang/sourcekit-lsp#1228
@ahoppen
Copy link
Member Author

ahoppen commented Jun 18, 2024

@ahoppen ahoppen merged commit 54dc593 into swiftlang:release/6.0 Jun 20, 2024
5 checks passed
@ahoppen ahoppen deleted the 6.0/enum-case-rename branch June 20, 2024 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants