You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SwiftFormat is giving me extra indentation when formatting code inside an #if block and I don't know why.
I'd like to format the following code as shown:
Essentially, I want to disable a block of code using #if but keep what's inside the block formatted as usual.
publicstructIfIndentView:View{publicvarbody:someView{Text("Hello")}#if false// Hi.task {
print("Some work here.")}#endif}
However, when I format this using swiftformat --swiftversion 5.9 --ifdef outdent (version 0.53.2), the code inside the #if has extra indentation in the comment before .task and in part of that block itself:
publicstructIfIndentView:View{publicvarbody:someView{Text("Hello")}#if false// Hi.task {
print("Some work here.")}#endif}
I couldn't find a good combination of configuration options to try to fix this, though if I remove the #if altogether, of course it formats correctly.
The text was updated successfully, but these errors were encountered:
SwiftFormat is giving me extra indentation when formatting code inside an
#if
block and I don't know why.I'd like to format the following code as shown:
Essentially, I want to disable a block of code using
#if
but keep what's inside the block formatted as usual.However, when I format this using
swiftformat --swiftversion 5.9 --ifdef outdent
(version 0.53.2), the code inside the#if
has extra indentation in the comment before.task
and in part of that block itself:I couldn't find a good combination of configuration options to try to fix this, though if I remove the
#if
altogether, of course it formats correctly.The text was updated successfully, but these errors were encountered: