nicklockwood / SwiftFormat

A command-line tool and Xcode Extension for formatting Swift code
MIT License
7.91k stars 639 forks source link

propertyWrappers nested in another type are not handled correctly #569

Closed JohnEstropia closed 4 years ago

JohnEstropia commented 4 years ago

PropertyWrappers may be nested in types like this:

enum Encoded {
    @propertyWrapper struct Json<V>  {
        // ...
    }
}

class Person {
    @Encoded.Json var firstName: String = "" // this line
}

Running swiftformat breaks the qualified name:

@Encoded .Json var firstName: String = "" // note space before .Json

This compiles normally, but would prefer the qualified name intact.

nicklockwood commented 4 years ago

@JohnEstropia fixed in 0.44.4. Thanks for reporting!