Bug 39357 - Better code formatting
Summary: Better code formatting
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows NT
: P3 enhancement (vote)
Target Milestone: 3.0 M4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-26 05:30 EDT by Jesper Nordenberg CLA
Modified: 2003-10-14 07:24 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesper Nordenberg CLA 2003-06-26 05:30:41 EDT
I would like the formatting of the following statement:

function(arg1, arg2, arg3);

to become:

function(arg1,
         arg2,
         arg3);

if there is enough space for it. Otherwise it should become (like today):

function(
  arg1,
  arg2,
  arg3);
Comment 1 Philipe Mulet CLA 2003-06-26 05:40:45 EDT
New code formatter should do what you want (once finalized).
You can experiment it in latest 3.0 integration build and some little tweaking 
to enable it (if you feel having some pioneer spirit).

Olivier can tell you how to enable it.
Comment 2 Olivier Thomann CLA 2003-06-26 09:09:59 EDT
This will be doable, but it won't depend if you have enough space. You will be
able to set the type of alignment.
Comment 3 Jesper Nordenberg CLA 2003-06-26 16:49:13 EDT
Ok, probably good enough. But what happens if:

function(arg1

doesn't fit on a line?
Comment 4 Olivier Thomann CLA 2003-06-27 10:46:52 EDT
According to the type of alignment you will get:
function(arg1,
....

or:
function(
    args1,
....

If you don't set any alignment (it will be an option) then there is simply no 
line splitting even if it goes beyond the page width.

We want to give flexibility to the user, but he/she will decide the way the 
code should be formatted.
Comment 5 Olivier Thomann CLA 2003-10-03 10:30:23 EDT
This is addressed in the new formatter.
Fixed and released in HEAD.
Regression test added.
Comment 6 David Audel CLA 2003-10-14 07:24:18 EDT
Verified.