vknabel / vscode-swiftformat

SwiftFormat for VS Code
https://marketplace.visualstudio.com/items?itemName=vknabel.vscode-swiftformat
MIT License
43 stars 8 forks source link

Add on-type formatting support after hitting "return" on non-empty lines #32

Closed MahdiBM closed 9 months ago

MahdiBM commented 10 months ago

Adds on-type formatting support after hitting "return" on non-empty lines.

This looks like this assuming you have the "editor.formatOnType": true:

https://github.com/vknabel/vscode-swiftformat/assets/54685446/7c1ce16d-30f7-44ac-97ea-975ac137ce6c

vknabel commented 10 months ago

Hi @MahdiBM, thanks for your contribution and sorry for the late response. Code-wise this looks perfectly fine and like a great feature. But if I remember correctly, formatting the whole file and replacing all contents while typing might break the edit history. Will give it a try.

MahdiBM commented 10 months ago

Command+Z works fine if that's a sign. I haven't noticed anything buggy about it, but feel free to try it yourself as I might have not tried something that you're thinking of.