You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you do "Format Selection" in VSCode, it'll format the selection out of context of the file, which can make it look weird because it won't properly take care of indentation etc...
It should instead take the whole file context into account, but only modify the selected lines.
Steps to reproduce
1:
2:
3:
4:
As you can see, in 4 indentation of the function is broken compared to the parent struct. There is also a weird extra space below the function after the indentation, not sure why.
Usage?
When working on team projects you might want to keep your own code-style clean, but don't force it on others.
Without a feature like this you always need to format the whole file instead of just the few lines you wrote.
The text was updated successfully, but these errors were encountered:
I just noticed this issue in swift-format repo: swiftlang/swift-format#297.
I thought it doesn't hurt to mention that they basically want to natively support what this issue requests.
I just notice this is the repository for Nick Lokwood's swift-format, but actually that makes the issue even better because i've now moved to the Nick Lockwood's swiftformat because Apple's swift-format doesn't seem actually useable in practically formatting stuff properly.
Thanks for the upcoming comments!
If I get this right, there is no issue in this repo and for the apple formatter extension, this is an upstream issue.
When you do "Format Selection" in VSCode, it'll format the selection out of context of the file, which can make it look weird because it won't properly take care of indentation etc...
It should instead take the whole file context into account, but only modify the selected lines.
Steps to reproduce
1:
2:
3:
4:
As you can see, in 4 indentation of the function is broken compared to the parent struct. There is also a weird extra space below the function after the indentation, not sure why.
Usage?
When working on team projects you might want to keep your own code-style clean, but don't force it on others.
Without a feature like this you always need to format the whole file instead of just the few lines you wrote.
The text was updated successfully, but these errors were encountered: