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
I don't think we currently do anything with the setting editor.formatOnType. It does come from VS Code so I agree that we should probably have our functionality check that setting. We currently have java.f\\ormat.onType.enabled (should be enabled by default) but according to it's description, it's mainly meant for the formatting of semicolon and curly braces. It does mention carriage return as well, but I'm not really finding a case where that does anything interesting.
You're right that if you call the formatter with default settings, after creating a line break in a statement, the formatting gets corrected, so it definitely looks like something is missing.
Update: I think it's related to how we establish the region to be formatted when particular trigger characters are typed. Maybe we're just not handling the next line when a newline is inserted. I'll have a closer look soon.
[formatOnType setting is not working, formatOnSave works]
Environment
Steps To Reproduce
"editor.formatOnType": true,
[Please attach a sample project reproducing the error]
Please attach logs
Current Result
Line break returns to beginning of the line
Expected Result
Line break should start after 2 tabs
Additional Informations
Attached a video where the formatting triggers when the file is saved but it should also work when creating a line break while typing.
vscode_cannot_format_java.mov
The text was updated successfully, but these errors were encountered: