swiftlang / swift-syntax

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

swift syntax should be able to recover function parameters without argument labels #2254

Open tayloraswift opened 1 year ago

tayloraswift commented 1 year ago

Description

SwiftParser currently can’t handle DocC-style abridged signatures such as:

init(String.Index, x:(Int) -> Int) rethrows

as they are considered malformed parse trees.

more details at https://forums.swift.org/t/swiftsyntax-how-to-repair-abbreviated-function-signatures/67602

ahoppen commented 1 year ago

Tracked in Apple’s issue tracker as rdar://116364935

AppAppWorks commented 3 months ago

I think this issue is similar to what #2727 has solved, maybe some generalization can be used to apply the solution to this issue too.