Bug 392324 - [Formatter] wraps single items after having seen too many items
Summary: [Formatter] wraps single items after having seen too many items
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.8   Edit
Hardware: PC Windows 7
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact: Ayushman Jain CLA
URL:
Whiteboard: stalebug
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2012-10-18 07:58 EDT by Arne Schröder CLA
Modified: 2020-02-08 12:16 EST (History)
4 users (show)

See Also:


Attachments
A screenshot of the faulty wrapping behaviour (194.22 KB, image/png)
2012-10-18 08:00 EDT, Arne Schröder CLA
no flags Details
File, formatted in a wrong way. (10.09 KB, text/plain)
2012-10-23 03:09 EDT, Arne Schröder CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arne Schröder CLA 2012-10-18 07:58:34 EDT
The formatter in my project is supposed to leave lines at a length of 150 characters.

However, in one file I do a long enumeration of all possible keywords. While the first few lines (about 50 lines, 476 keywords) are correctly formatted, the formatter gives up at one point without me seeing the reason, why.

See the attachment for details.
Comment 1 Arne Schröder CLA 2012-10-18 08:00:31 EDT
Created attachment 222516 [details]
A screenshot of the faulty wrapping behaviour

Now the attachment...
Comment 2 Jay Arthanareeswaran CLA 2012-10-23 01:11:23 EDT
There must be something about this file or your setting. I can't reproduce with a similar case.

Have you customized the formatter, by any chance? If so, can you share the attached format and the file with the problem? It would be ideal if you can isolate the code that you have problem with and attach it here. Thanks!
Comment 3 Arne Schröder CLA 2012-10-23 03:09:47 EDT
Created attachment 222670 [details]
File, formatted in a wrong way.

Sorry about that.

It seems to have something to do with comments, I inserted into the list. I tried it with different profiles and the problem occured in each one of them.
Comment 4 Jay Arthanareeswaran CLA 2012-10-26 02:43:48 EDT
(In reply to comment #3)
> Created attachment 222670 [details]
> File, formatted in a wrong way.
> 
> Sorry about that.
> 
> It seems to have something to do with comments, I inserted into the list. I
> tried it with different profiles and the problem occured in each one of them.

Thanks and I can reproduce it with the file and as you said the comments seem to make the difference. And the happens regardless of the line wrapping width.
Comment 5 Jay Arthanareeswaran CLA 2012-10-26 06:02:02 EDT
The formatter behaves very erratically when we have comments in an array initializer. Not sure if the fix can be simple.

If anyone can work on this and come up with a patch, we can consider.
Comment 6 Ayushman Jain CLA 2012-11-07 04:52:52 EST
This should most probably get fixed with the patch in bug 303519
Comment 7 Eclipse Genie CLA 2020-02-08 12:16:03 EST
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.