i think everyone is familiar with abbreviated function signatures from places like DocC documentation (although DocC doesn’t actually generate them, the swift compiler generates them.)
here’s an example:
init(String.Index, x:(Int) -> Int) rethrows
i’ve wasted far more time than i would like to admit trying to get SwiftSyntax to understand them, but because unlabeled parameters aren’t prefixed with the usual
_: tokens, SwiftSyntax just doesn’t consider them well-formed syntax:
if you try pasting the signature above into a tool like https://swift-ast-explorer.com/ , you will see that the syntax tree is completely broken:
i’ve tried a few absurd hacks to try and help SwiftSyntax digest these signatures, but there just doesn’t seem to be a way to work around the fact that lib/SymbolGraphGen¹ doesn’t emit well-formed signatures.
how can i repair these signatures so that SwiftSyntax can understand them?