Closed honghaoz closed 1 year ago
@honghaoz fixed in 0.51.8
Thanks for fixing for the example above. However, it broke the following code:
// original code
private func makeNode() -> LayoutNode {
guard someFlag else {
return Empty()
}
#if os(macOS)
return ClearNode()
.onEvent(
mouseEntered: { [weak self] touchingView, event in
self.isHovering = true
return true
},
mouseExited: { [weak self] touchingView, event in
self.isHovering = false
return true
},
)
#endif
}
// badly formatted code
private func makeNode() -> LayoutNode {
guard someFlag else {
return Empty()
}
#if os(macOS)
return ClearNode()
.onEvent(
mouseEntered: { [weak self] touchingView, event in // <-- this line is broken
self.isHovering = true
return true
},
mouseExited: { [weak self] touchingView, event in
self.isHovering = false
return true
},
)
#endif
}
// removing the guard let on top works well
private func makeNode() -> LayoutNode {
#if os(macOS)
return ClearNode()
.onEvent(
mouseEntered: { [weak self] touchingView, event in
self.isHovering = true
return true
},
mouseExited: { [weak self] touchingView, event in
self.isHovering = false
return true
},
)
#endif
}
@honghaoz this is also fixed by the fix for https://github.com/nicklockwood/SwiftFormat/issues/1440
New release? :)
The following code indentation is broken:
Would expect to be:
I believe this is an old problem for a long time. Not related to Swift 5.8 or SwiftFormat 0.51.7