| Summary: | [formatter] Erroneous formatting for left curly brace on line wrap | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | John Vines <jvines> |
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
| Status: | CLOSED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | jarthana, manoj.palat, mateusz.matela, noopur_gupta |
| Version: | 4.5.1 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
I don't see this effect. There are probably some other settings or surrounding code that affects this bug. Can you try to reproduce the bug starting with a fresh workspace and write down more details? It must have been an issue with the file at the time of formatting. I went back to try and repro it in a new workspace and I couldn't even get the original troublesome line to do it again. |
The behavior of formatting brace placement when a line wraps seems to be erroneous, or at least not configurable. What I'm getting- if (!longConditionalCheckOfWhichOnlyOneCanFitOnALineAndForcesAWrap(argument1, argument2) || !longConditionalCheckOfWhichOnlyOneCanFitOnALineAndForcesAWrap(argument1, argument2)) { doSomething(); } What I expect if (!longConditionalCheckOfWhichOnlyOneCanFitOnALineAndForcesAWrap(argument1, argument2) || !longConditionalCheckOfWhichOnlyOneCanFitOnALineAndForcesAWrap(argument1, argument2)) { doSomething(); } In my formatter, I have Braces->Blocks set to next line on wrap. If I set it to next line, I get the correct behavior here (but then it will always go on the next line which I don't want). I would expect these two different settings to have the same behavior on lines which wrap, and that is currently not the case.