Bug 515244 - [Formatter] array elements and enum elements line wrap: don't touch
Summary: [Formatter] array elements and enum elements line wrap: don't touch
Status: REOPENED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.6   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-13 07:13 EDT by Marvin Fröhlich CLA
Modified: 2024-05-16 11:18 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marvin Fröhlich CLA 2017-04-13 07:13:30 EDT
There should be an option to tell the formatter not to tough line wrapping for array initializer elements.

In our code we have some cases, where we want array elements to be wrapped all in single lines and sometimes we want them all in one line. Rawly speaking, if used as method call argument, the elements should always be in one line. If used in array variable initialization, they should always be in separate lines. But there are exceptions to this rule.

If there was an option to don't tough line wrapping for array elements and enum elements we could more thoughtlessly apply the formatter to a whole file.
Comment 1 Marvin Fröhlich CLA 2017-04-13 07:14:00 EDT
This may also apply to other things.
Comment 2 Mateusz Matela CLA 2017-04-22 14:32:31 EDT
Yeah, adding such a feature specifically for array initializers is out of the question.
It seems a proper solution would be to create a new wrapping policy, like "Wrap where necessary, never join already wrapped lines". It would render the current global "Never join..." setting deprecated.

I had this idea for some time, but it's a really major change and it will probably wait for a long time for implementation. For now you could use the formatter:off tags as a workaround.
Comment 3 Eclipse Genie CLA 2020-03-25 15:46:40 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 4 Marvin Fröhlich CLA 2020-04-07 02:29:25 EDT
I didn't even know that "Never wrap" setting. It helped a bit. But of course the main issue persists.
Comment 5 Eclipse Genie CLA 2022-03-29 18:35:56 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 6 Nobody - feel free to take it CLA 2022-05-24 11:30:17 EDT
Could you clarify how "Never join already wrapped lines" does not address your need?
Comment 7 Eclipse Genie CLA 2024-05-16 11:18:45 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.