[swift-evolution] Source Formatting

Ben Rimmington me at benrimmington.com
Sun Mar 13 15:22:14 CDT 2016


> On 13 Mar 2016, at 02:45, Paul Ossenbruggen via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Actually, I think this is a cool idea and I had thought along these lines too actually years ago of saving in an intermediate format. The difference that I am thinking now is that there is a Swift standard format. Where the “standard” format is what is written, but the IDE displays it in the users’ favorite format. This would not lead to diffing problems since it would be stored in Swift standard format that everyone can read and would readable and editable any text editor. So the standard might have braces at the end of the line, but when you open it in your IDE it will put them in your preferred aligned position, when it is saved, it goes back to standard format. I would not be surprised if something like this existed already (not specifically for Swift)

C++ examples:

<http://clang.llvm.org/docs/ClangFormatStyleOptions.html#examples>

Old demo (video):

<https://channel9.msdn.com/Events/GoingNative/2013/The-Care-and-Feeding-of-C-s-Dragons#time=23m30s>

-- Ben


More information about the swift-evolution mailing list