swift-plugin icon indicating copy to clipboard operation
swift-plugin copied to clipboard

Formatter

Open jansorg opened this issue 2 years ago • 2 comments

Request for Feedback

Please share your thoughts and ideas about the best experience for a Swift source code formatter.

jansorg avatar Jun 27 '23 21:06 jansorg

I would LOVE if this package supported formatting.

https://github.com/nicklockwood/SwiftFormat

That appears to be the easiest to achieve it. It would be great if there was a "format on save" option. As well as if IntelliJ picked it up as a formatter so I could run it on a full file.

I'd personally say the more opinionated the better. But would also make sense if it supported having an optional configuration file if you wanted to configure it: https://github.com/nicklockwood/SwiftFormat (or bonus - if you could do this from IntelliJ settings).

Apple has their own, which I'd be fine with as well: https://github.com/apple/swift-format

kvenn avatar Sep 28 '23 20:09 kvenn

I've set up the File Watcher plugin with SwiftFormat to automatically format my files on save.

image

kvenn avatar Oct 31 '23 21:10 kvenn