Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On-type formatting doesn't appear to work #42

Closed
tristanlabelle opened this issue Jun 12, 2024 · 6 comments · Fixed by #46
Closed

On-type formatting doesn't appear to work #42

tristanlabelle opened this issue Jun 12, 2024 · 6 comments · Fixed by #46

Comments

@tristanlabelle
Copy link
Collaborator

I'm not getting formatting when hitting enter (we're currently registering it for "\n" characters), nor after modifying it to "}", when I type that character.

@MahdiBM
Copy link
Collaborator

MahdiBM commented Jun 14, 2024

@tristanlabelle Are you on the latest version? Works fine for me on 1.7.0.
If you hit \n and the new line is not an empty line, SwiftFormat should be triggered.

@vinocher-bc
Copy link
Contributor

@MahdiBM did you mean 1.6.9, which seems to be the latest version? Currently, formatting on Enter isn't working for me either on Windows in version 1.6.9.

@MahdiBM
Copy link
Collaborator

MahdiBM commented Jun 17, 2024

Hmm I thought I saw a higher version.
Maybe you need to enable the "format on type" somehow?

@MahdiBM
Copy link
Collaborator

MahdiBM commented Jun 17, 2024

Ah i had manually installed a version 1.7.0 locally with my own changes. Regardless, when I enable format-on-type:

"editor.formatOnType": true

it just works for me.

@vinocher-bc
Copy link
Contributor

"editor.formatOnType": true was missing. Thanks.

@MahdiBM
Copy link
Collaborator

MahdiBM commented Jun 17, 2024

Perhaps there should be some documentation for that, that we add 🙂.

vknabel added a commit that referenced this issue Jun 22, 2024
vknabel added a commit to vknabel/vscode-apple-swift-format that referenced this issue Jun 22, 2024
vknabel added a commit to vknabel/vscode-apple-swift-format that referenced this issue Jun 22, 2024
vknabel added a commit that referenced this issue Jun 22, 2024
vknabel added a commit to vknabel/vscode-apple-swift-format that referenced this issue Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants