swiftlang / swift-syntax

A set of Swift libraries for parsing, inspecting, generating, and transforming Swift source code.
Apache License 2.0
3.22k stars 410 forks source link

Fix renaming enum case parameters with unnamed associated arguments #2678

Closed ahoppen closed 3 months ago

ahoppen commented 3 months ago

Linked to and https://github.com/apple/swift/pull/74241 and https://github.com/apple/sourcekit-lsp/pull/1471

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. Report enumCaseParameters as a special parameter kind so that sourcekitd can work with it.

https://github.com/apple/sourcekit-lsp/issues/1228

ahoppen commented 3 months ago

https://github.com/apple/swift/pull/74241 https://github.com/apple/sourcekit-lsp/pull/1471

@swift-ci Please test

ahoppen commented 3 months ago

https://github.com/apple/swift/pull/74241 https://github.com/apple/sourcekit-lsp/pull/1471

@swift-ci Please test

ahoppen commented 3 months ago

https://github.com/apple/swift/pull/74241 https://github.com/apple/sourcekit-lsp/pull/1471

@swift-ci Please test Windows