Open arlomedia opened 3 years ago
@arlomedia Thanks for the suggestions! Keeping original style is way more difficult than just reformatting the output, but we are getting there. I'll split this into a few issues, but this may take a while to be implemented.
Okay. I was hoping this would be a matter of not reformatting the output and just leaving the formatting as it was.
For the most part, Swiftify has been good about preserving the line breaks as I had them in my code. By comparison, this was a big problem I had with the Kotlin converter in Android Studio, which was eager to remove empty lines that I used to organize and separate blocks of code. But Swiftify has still done this in some cases:
1) If I have many elements in a conditional, it is sometimes nice to break them into separate lines for readability. For example:
This is changed to:
Converter example: http://swiftify.me/23yd31/1
2) Conversely, I sometimes have a series of very short conditionals that I like to put on one line. For example:
(Yes, that could use max and min functions; this is just an example.) This is changed to:
Converter example: http://swiftify.me/mvecpr/2
3) Some classes have dozens of properties, and I use empty lines to group related properties. These lines were preserved for most of my project, but did a recent converter update change this? The last few files I converted had these empty lines stripped out. Hopefully this was not a side effect of issue 153. For example:
This is changed to:
Converter example: http://swiftify.me/zyu8zi