Bug 50276 - Function call line wrapping fails on chained calls
Summary: Function call line wrapping fails on chained calls
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal with 1 vote (vote)
Target Milestone: 3.0 M7   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-20 11:23 EST by Charles Oliver Nutter CLA
Modified: 2004-02-12 15:26 EST (History)
0 users

See Also:


Attachments
Image showing bad chained function formatting (98.50 KB, image/jpeg)
2004-01-20 11:25 EST, Charles Oliver Nutter CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Charles Oliver Nutter CLA 2004-01-20 11:23:05 EST
If I have code like the following:

StringBuffer myBuf = new StringBuffer();

myBuf.append("first").append("second").append("third");

I would usually want to format it as

myBuf.append("first")
    .append("second")
    .append("third")

..or possibly with the first line also wrapped. Currently, no combination of
line wrapping settings will cause this to happen. Even if "force split" is
combined with the available wrapping options, the entire line is only wrapped
"as neccessary". When method calls are not chained, the splitting and wrapping
occurs correctly.

It appears that a chain of method calls is not being subjected to the line
wrapping rules for function calls (or at least, is not formatting as would be
expected).

An image will be attached showing a long chain of method calls being incorrectly
formatted. The formatting shown is constant regardless of line wrapping settings.
Comment 1 Charles Oliver Nutter CLA 2004-01-20 11:25:19 EST
Created attachment 7488 [details]
Image showing bad chained function formatting

This image shows the incorrect formatting of chained function calls. This
formatting does not change regardless of line wrapping settings.
Comment 2 Charles Oliver Nutter CLA 2004-01-20 11:27:13 EST
Reported against: 200401150010
Comment 3 Olivier Thomann CLA 2004-02-05 13:08:16 EST
This bug is due to the fact that I wasn't using the options for alignment inside
a cascading method invocations.
Using the option for alignment of qualified method invocation fixed it. Using
your example, I now get the attached result.

I think this is what is expected.
Fixed and released in HEAD.
Comment 4 Olivier Thomann CLA 2004-02-12 15:26:17 EST
Verified in 200402121200.