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
Running swift-format breaks the following by inserting an invalid line break:
#if (canImport(SwiftUI) && !(os(iOS) && arch(arm))) && ((canImport(AppKit) || canImport(UIKit)) && !os(watchOS))// (↑ This is all one line, despite the browser being allowed to wrap it.)#endif
↓
#if (canImport(SwiftUI) && !(os(iOS) && arch(arm)))&&((canImport(AppKit) || canImport(UIKit)) && !os(watchOS))// (↑ This is the hard line break produced by swift-format)#endif
The text was updated successfully, but these errors were encountered:
It looks like the entire condition must be wrapped in parens in order for line breaks inside of the condition to be allowed. For example, the following version of the snippet compiles correctly:
Unfortunately, swift-format's model doesn't easily support conditionally inserting those parens around the entire condition when a line break is necessary. In order to prevent breaking code that goes through the formatter, I plan to disable inserting additional line breaks within these conditions.
Additional Detail from JIRA
md5: e60c37c6151823b9b5421744407ba149
Issue Description:
Running swift-format breaks the following by inserting an invalid line break:
↓
The text was updated successfully, but these errors were encountered: