| Summary: | Code formatter repeatedly adds newline before formatter:off region in enum declaration | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Andre Bargull <andrebargull+eclipse> |
| Component: | Core | Assignee: | Mateusz Matela <mateusz.matela> |
| Status: | VERIFIED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | jarthana, mateusz.matela, wigbam |
| Version: | 3.8 | ||
| Target Milestone: | 4.8 M6 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | To be verified for 4.8 M6 | ||
This bug is still present in the 4.4 release. This problem no longer occurs after the formatter redesign. *** This bug has been marked as a duplicate of bug 303519 *** Verified for Eclipse Photon (4.8) M6 with Build id: I20180306-0800 |
Build Identifier: Version: Indigo Service Release 2 Build id: 20120216-1857 Whenever the code format action is triggered, the formatter adds another newline before the `//@formatter:off` comment. I'm using a slightly modified version of the "Eclipse [built-in]" code formatter settings. To reproduce the bug the following two options need to be changed: - Line Wrapping > 'enum' declaration > Constants > Policy -> "Wrap where necessary" - Off/On Tags -> Enabled And here's the code in question: --- package bugs; public class EclipseFormatBug { enum MyEnum { // @formatter:off someEnumConstantWithLongName, anotherEnumConstantWithAnEvenLongerName, stillAnotherEnumConstant; // @formatter:on } } --- Reproducible: Always