Summary: | [formatter] Does not line-break method declaration exception with parameters | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Colm Smyth <lateralcoder> | ||||||||
Component: | Core | Assignee: | Frederic Fusier <frederic_fusier> | ||||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||||
Severity: | normal | ||||||||||
Priority: | P3 | CC: | frederic_fusier, Olivier_Thomann, rbrewer, satyam.kandula, srikanth_sankaran | ||||||||
Version: | 3.4.2 | ||||||||||
Target Milestone: | 3.6 M6 | ||||||||||
Hardware: | PC | ||||||||||
OS: | Linux | ||||||||||
Whiteboard: | |||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 303773 | ||||||||||
Attachments: |
|
Description
Colm Smyth
2009-07-27 13:55:42 EDT
Created attachment 159574 [details]
Possible patch
This simplest patch which easily fixes the problem.
It only adds possible line break at the following positions of the method declaration:
1) after the modifiers
2) after the type parameters if any
3) after the return type
4) after the method name
The proposed wrapping is not configurable and always indent the wrapped line at the same column than the method declaration start.
E.g., the following snippet:
public interface X {
public List<SampleContainer<SampleClass>> getSampleContainer();
}
would be formatted as follow with a max line width=40:
public interface X {
public
List<SampleContainer<SampleClass>>
getSampleContainer();
}
Would this proposal address your needs or would you need the wrapping configurable through the formatter preferences?
Talking with Olivier about this, we decided to add a new preferences for this behavior to let user decide what kind of wrapping he/she wants around these new points of breakage in the method declaration... I'll be back soon with a new patch. Created attachment 159906 [details]
New proposed patch
This patch adds a new formatter option to control the wrapping of the method declaration. Note that it also removes the break after the method name which looked a little bit weird after having made some tests...
Created attachment 159929 [details]
New proposed patch + doc
Same patch than the previous one + add an entry in the build notes...
(In reply to comment #4) > Created an attachment (id=159929) [details] > New proposed patch + doc > Released for 3.6M6 in HEAD stream. Verified for 3.6M6 using build I20100305-1011 |