-
Notifications
You must be signed in to change notification settings - Fork 414
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
Java code formatter rules is ignored #1640
Comments
@CsCherrYY Could you please take a look at this formatting issue? |
Hi, @CarlPer , it seems a formatter version bug. The formatter version of template in |
For anyone else who stumbles onto this issue, I had to add more config: <setting id="org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line" value="one_line_if_empty" />
<setting id="org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line" value="one_line_if_empty" />
<setting id="org.eclipse.jdt.core.formatter.keep_method_body_on_one_line" value="one_line_if_empty" /> to support: class Foo {
Foo() {}
} and class Bar {} |
https://github.com/eclipse/eclipse.jdt.ui/blob/master/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/preferences/formatter/ProfileVersionerCore.java#L32 mentions the current version as well as a utility method to update older settings to any version. Update : Ah, I see you found the option as well. |
@rgrunber Yes. eclipse-jdtls/eclipse.jdt.ls@704e50b uses the utility you mentioned to check if there is any need to update the profile. |
This rule is ignored when formatting:
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="do not insert"/>
Environment
Steps To Reproduce
Current Result
Expected Result
Additional Informations
The text was updated successfully, but these errors were encountered: