Lines 48-56
Link Here
|
48 |
<br>Project org.eclipse.jdt.core v_A54 |
48 |
<br>Project org.eclipse.jdt.core v_A54 |
49 |
(<a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jdt.core/?only_with_tag=v_A54">cvs</a>). |
49 |
(<a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jdt.core/?only_with_tag=v_A54">cvs</a>). |
50 |
<h2>What's new in this drop</h2> |
50 |
<h2>What's new in this drop</h2> |
|
|
51 |
<ul> |
52 |
<li> |
53 |
Added a new preference to force the formatter to try to keep nested expressions on one line. |
54 |
<p> |
55 |
This new preference is controlled with the option:</p> |
56 |
<code>DefaultCodeFormatterConstants.FORMATTER_KEEP_NESTED_EXPRESSIONS_ON_ONE_LINE</code> |
57 |
<pre> |
58 |
/** |
59 |
* FORMATTER / Option to wrap outer expressions first in nested expressions |
60 |
* - option id: "org.eclipse.jdt.core.formatter.wrap_outer_expressions_first_when_nested" |
61 |
* - possible values: { TRUE, FALSE } |
62 |
* - default: TRUE |
63 |
* |
64 |
* This option changes the formatter behavior when nested method calls are encountered. |
65 |
* Since 3.6, the formatter tries to wrap outermost method calls first to have a better output. |
66 |
* For example, let's say we are using the Eclipse built-in profile with a max line width=40+space for tab policy. |
67 |
* Then consider the following snippet: |
68 |
* |
69 |
* public class X01 { |
70 |
* void test() { |
71 |
* foo(bar(1, 2, 3, 4), bar(5, 6, 7, 8)); |
72 |
* } |
73 |
* } |
74 |
* |
75 |
* With this new strategy, the formatter will wrap the line earlier, between the arguments of the message call |
76 |
* for this example, and then it will allow to keep each nested call on a single line. |
77 |
* Hence, the output will be: |
78 |
* |
79 |
* public class X01 { |
80 |
* void test() { |
81 |
* foo(bar(1, 2, 3, 4), |
82 |
* bar(5, 6, 7, 8)); |
83 |
* } |
84 |
* } |
85 |
* |
86 |
* Important notes: |
87 |
* 1. This new behavior is automatically activated (ie. the default value for this preference is {@link #TRUE}). |
88 |
* If the backward compatibility regarding previous versions formatter behavior (ie. before 3.6 version) is necessary, |
89 |
* then the preference needs to be set to the {@link #FALSE} value to retrieve the previous formatter behavior. |
90 |
* 2. The new strategy currently only applies to nested method calls, but might be extended to other nested expressions in future versions |
91 |
* |
92 |
* @see #TRUE |
93 |
* @see #FALSE |
94 |
* @since 3.6 |
95 |
*/ |
96 |
</pre> |
97 |
See bug <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=313524">313524</a> for more details. |
98 |
</li> |
99 |
</ul> |
51 |
|
100 |
|
52 |
<h3>Problem Reports Fixed</h3> |
101 |
<h3>Problem Reports Fixed</h3> |
53 |
<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=313109">313109</a> |
102 |
<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=313524">313524</a> |
|
|
103 |
[formatter] Add preference for improved lines wrapping in nested method calls |
104 |
<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=313109">313109</a> |
54 |
@SuppressWarnings on multiple locals is marked unnecessary if any local is never used |
105 |
@SuppressWarnings on multiple locals is marked unnecessary if any local is never used |
55 |
|
106 |
|
56 |
<a name="v_A53"></a> |
107 |
<a name="v_A53"></a> |