Bug 181547 - Code formatter: differentiate "insert new line after annotations" on location
Summary: Code formatter: differentiate "insert new line after annotations" on location
Status: VERIFIED DUPLICATE of bug 122247
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: 3.4 M5   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-09 00:41 EDT by Matt Whitlock CLA
Modified: 2008-02-05 10:29 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Whitlock CLA 2007-04-09 00:41:18 EDT
The Code Formatter has an option to "Insert new line after annotations" that applies to all annotations.  This is a request for enhancement to allow this option to be specified independently for each possible annotation location: annotation type, constructor, field, local variable, method, package, parameter, and type.

For example, the following may be a desired format:

@Deprecated
@SuppressWarnings("unused")
public void setFoo(@Required String foo) {
}

The current implementation only allows one of the following:

@Deprecated @SuppressWarnings("unused") public void setFoo(@Required String foo) {
}

-OR-

@Deprecated
@SuppressWarnings("unused")
public void setFoo(@Required
String foo) {
}

Neither of these is particularly attractive.
Comment 1 Matt Whitlock CLA 2007-04-09 00:42:17 EDT
The line break after "String" in the first example of the current implementation is an artifact of Bugzilla.
Comment 2 Olivier Thomann CLA 2007-04-09 09:57:59 EDT
This is too late to fix it for 3.3 since it would require a new code formatter option and this would be an API addition.
Comment 3 Olivier Thomann CLA 2007-06-21 13:19:04 EDT

*** This bug has been marked as a duplicate of bug 122247 ***
Comment 4 Jerome Lanneluc CLA 2008-02-05 10:29:10 EST
The option has been split in 3:
- annotation on members (this includes classes, fields, and methods)
- annotation on local variables
- annotation on parameters
Please reopen if you really need more options (e.g. to distinguish between method and constructor). A use case describing this need would help.

Verified for 3.4M5 using I20080205-0010