| Summary: | [formatter] operator line wrapping preferences do not respect assignment operator | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Brandon Yarbrough <brandonY> |
| Component: | Core | Assignee: | Mateusz Matela <mateusz.matela> |
| Status: | RESOLVED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P5 | CC: | jarthana, mateusz.matela, todd_richmond |
| Version: | 3.4 | ||
| Target Milestone: | 4.5 M6 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Brandon Yarbrough
A code snippet showing the issue would be helpful... Here is a sample that breaks on both normal assignment and annotations using Eclipse Java code cleanup. My settings are to wrap at column 80 and line break when necessary. The variable declaration should break after a "+" (I have it set to break after an operator).
Also, manually adding a CR after the = causes the next line to begin on column 20 instead of a single 4 char indent. Sames goes for the annotation
I've tried every combination of wrap and extra options possible and cannot get this to format correctly
import com.wordnik.swagger.annotations.ApiResponse;
import com.wordnik.swagger.annotations.ApiResponses;
public class EclipseFormatTest {
// no wrapping (bugzilla breaks comment)
public int a23456789012345678901234567890 = 1234567890 + 1234567890 + 1234567890;
// line should keep message = on 1st line
@ApiResponses(value = { @ApiResponse(code = 400,
message = "invalid start or count supplied") })
public void func() {}
}
The results should be
public class EclipseFormatTest {
public int a23456789012345678901234567890 = 1234567890 + 1234567890 +
1234567890;
@ApiResponses(value = { @ApiResponse(code = 400, message =
"invalid start or count supplied") })
public void func() {}
}
This problem no longer occurs after the formatter redesign. *** This bug has been marked as a duplicate of bug 303519 *** Verified for 4.10 M3 with build id I20181121-1800 |