Closed mikemahony closed 10 months ago
When you have a comment before an #if the indentation of any chained modifier is unexpected.
#if
struct ContentView: View { var body: some View { // swiftformat:options --ifdef indent Text("Hello, world!") // Comment above #if os(macOS) .padding() #endif Text("Hello, world!") #if os(macOS) // Comment inside .padding() #endif // swiftformat:options --ifdef no-indent Text("Hello, world!") // Comment above #if os(macOS) .padding() #endif Text("Hello, world!") #if os(macOS) // Comment inside .padding() #endif // swiftformat:options --ifdef outdent Text("Hello, world!") // Comment above #if os(macOS) .padding() #endif Text("Hello, world!") #if os(macOS) // Comment inside .padding() #endif } }
All three --ifdef options.
--ifdef
@mikemahony thanks for reporting this - I've added a fix for the next release.
@mikemahony fixed in 0.52.5
When you have a comment before an
#if
the indentation of any chained modifier is unexpected.Input
Configuration
All three
--ifdef
options.Expected output
Actual output