Bug 34897 - Code Formatter feature request
Summary: Code Formatter feature request
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 enhancement (vote)
Target Milestone: 3.0 M6   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-13 05:40 EST by Christopher Harper CLA
Modified: 2003-12-17 06:37 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Harper CLA 2003-03-13 05:40:28 EST
The Code Formatter should have more options in it. Currently Code is formatted 
so that all the spaces are removed around method arguments method(arg1, arg2); 
id like to see the option of leading and trailing spaces like: method
(arg1,arg2); ,  method(arg1, arg2); , method( arg1, arg2 ) ;, method( arg1 , 
arg2 )  ;, method ( arg1 , arg2 ) ;… 

Also the line wrapping could be modified like:

StringBuffer sql = new StringBuffer( ConstTypes.SOME_TYPE ) ;
sql.append( " WHERE " ).append( ConstAttrs.SOME_ATTR1 )
  .append( " = '" ).append( someValue1 ).append( "' AND" )
  .append( ConstAttrs.SOME_ATTR2 ).append( " = '" ).append( someValue2 )
  .append( "' AND " ) ;

Instead of setting each append on its own line. This obviously should apply to 
other wrapping settings too.

Br, Chris
Comment 1 Christopher Harper CLA 2003-03-13 06:19:11 EST
Allso the sort members could have distinction between public, protected and 
private methods/variables.

Br, Chris
Comment 2 Adam Kiezun CLA 2003-03-13 06:49:21 EST
formatter is core
Comment 3 Jerome Lanneluc CLA 2003-03-13 07:20:10 EST
Code formatter is going to be reworked post 2.1.
Comment 4 Christopher Harper CLA 2003-03-13 09:58:04 EST
Thanks!
Comment 5 Philipe Mulet CLA 2003-06-12 06:35:58 EDT
Resurrecting for 3.0
Comment 6 Olivier Thomann CLA 2003-06-12 15:58:47 EDT
Reopen for 3.0 consideration.
Comment 7 Olivier Thomann CLA 2003-12-04 22:22:21 EST
Could you please check if the new formatter preference page allows you to set up
the formatting like you want?
You can finely control the whitespaces added in the formatted string.

The sorting of elements is not done by the formatter, but can be done in the UI
by selecting the Source menu>Sort members.
Comment 8 Olivier Thomann CLA 2003-12-05 07:54:05 EST
Fixed in HEAD.
Comment 9 David Audel CLA 2003-12-17 06:37:18 EST
Verified for 3.0M6