swiftlang / swift-format

Formatting technology for Swift source code
Apache License 2.0
2.38k stars 216 forks source link

Make sure there is a break after an #endif. #729

Closed shawnhyam closed 2 months ago

shawnhyam commented 2 months ago

You wouldn't normally allow a line break just before the comma in a parameter list, but if the preceding line is an #endif, we have to be sure to include the break or we'll generate invalid code. Fix #705.

allevato commented 2 months ago

Wow, I guess I've never used postfix-#if in a comma-delimited list before; having to put a newline before the comma is super unfortunate 😞 Thanks for the fix!