Bug 282030 - [formatter] Java annotation formatting
Summary: [formatter] Java annotation formatting
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.6 M6   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 207809 310448 (view as bug list)
Depends on:
Blocks: 281655 303314
  Show dependency tree
 
Reported: 2009-06-30 11:50 EDT by Chris McMillan CLA
Modified: 2010-07-01 11:14 EDT (History)
4 users (show)

See Also:


Attachments
Proposed patch (20.61 KB, patch)
2010-02-19 09:05 EST, Frederic Fusier CLA
no flags Details | Diff
Proposed patch (24.60 KB, patch)
2010-02-19 09:19 EST, Frederic Fusier CLA
no flags Details | Diff
Proposed patch + doc (28.85 KB, patch)
2010-02-22 11:45 EST, Frederic Fusier CLA
no flags Details | Diff
Additional patch (7.09 KB, patch)
2010-02-23 05:51 EST, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris McMillan CLA 2009-06-30 11:50:01 EDT
As an enhancement I would like to see the ability to edit the line wrapping for annotations in the formating. For example
@DeclareParents(value = "com.apress.springrecipes.calculator.ArithmeticCalculatorImpl", defaultImpl = MaxCalculatorImpl.class) 
should be 
@DeclareParents(value = "com.apress.springrecipes.calculator.ArithmeticCalculatorImpl",
							defaultImpl = MaxCalculatorImpl.class)
							
It seems that all of the other formatting options are available under "Line Wrapping" except for annotations.
Comment 1 Frederic Fusier CLA 2010-02-19 09:05:11 EST
Created attachment 159543 [details]
Proposed patch

This new patch propose a new formatter option to align annotation arguments (ie. element-value pairs)... Note that this patch also fixes bug 281655 issue as the 'Never join lines' needs an alignment to be activated...
Comment 2 Frederic Fusier CLA 2010-02-19 09:19:57 EST
Created attachment 159549 [details]
Proposed patch

Fix a failing existing test on annotations formatting...
Comment 3 Frederic Fusier CLA 2010-02-22 11:45:38 EST
Created attachment 159813 [details]
Proposed patch + doc

Same patch as previous synchronized with HEAD + an entry in the build notes...
Comment 4 Frederic Fusier CLA 2010-02-22 11:46:05 EST
(In reply to comment #3)
> Created an attachment (id=159813) [details]
> Proposed patch + doc
> 
> Same patch as previous synchronized with HEAD + an entry in the build notes...

Released for 3.6M6 in HEAD stream.
Comment 5 Frederic Fusier CLA 2010-02-23 05:51:34 EST
Created attachment 159908 [details]
Additional patch

This patch changes the default value to WRAP_NO_SPLIT in order to avoid breaking current formatter behavior. Hence, to have this new functionality activated, users need to explicitly set the corresponding preferences...
Comment 6 Frederic Fusier CLA 2010-02-23 05:57:06 EST
(In reply to comment #5)
> Created an attachment (id=159908) [details]
> Additional patch
> 
Released for 3.6M6 in HEAD stream.
Comment 7 Srikanth Sankaran CLA 2010-03-09 04:43:32 EST
Verified for 3.6M6 using build I20100305-101
Comment 8 Frederic Fusier CLA 2010-05-12 07:26:41 EDT
*** Bug 310448 has been marked as a duplicate of this bug. ***
Comment 9 Frederic Fusier CLA 2010-07-01 11:14:08 EDT
*** Bug 207809 has been marked as a duplicate of this bug. ***