Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 258056

Summary: [formatter] Nested message should better split when line is getting too long
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: JDT Core Triaged <jdt-core-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: frederic_fusier, Olivier_Thomann
Version: 3.5   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug
Attachments:
Description Flags
Source code before
none
Source code after formatting
none
Suggested output none

Description Philipe Mulet CLA 2008-12-09 06:49:03 EST
Version: 3.5.0 - Build id: I20081209-0100

In presence of nested messages on a very long line, the formatter is trying to compact the arguments in a suboptimal way.

Testcases are too long to wrap properly in bugzilla, will store them as attachments.
Comment 1 Philipe Mulet CLA 2008-12-09 06:49:55 EST
Created attachment 119892 [details]
Source code before
Comment 2 Philipe Mulet CLA 2008-12-09 06:51:55 EST
Created attachment 119895 [details]
Source code after formatting

Observe that nested "foo(" invocations are indented deeper than their respective arguments. 

Likely a consequence of the compact mode since day 1, but this feels hard to read.
Comment 3 Philipe Mulet CLA 2008-12-09 06:54:04 EST
Created attachment 119896 [details]
Suggested output

This solution would read better IMHO.
Comment 4 Philipe Mulet CLA 2008-12-09 06:54:28 EST
Note: line wrapping is set at 80
Comment 5 Eclipse Genie CLA 2020-02-04 17:03:55 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.