I rely on the Eclipse "Correct Indentation" (ctrl+i) function but it does not indent correctly on varargs on multiple lines.
Example Original
import java.util.Arrays;
import java.util.List;
public class WrongIndent
{
String s = "Hello World";
List x = Arrays.asList(
s.substring(
1,
2)
,s.substring(
1,
2)
,s.substring(
2,
3)
,s.substring(
4,
5)
);
}
Output of "Correct Indentation"
How can I fix this?
import java.util.Arrays;
import java.util.List;
public class WrongIndent
{
String s = "Hello World";
List x = Arrays.asList(
s.substring(
1,
2)
,s.substring(
1,
2)
,s.substring(
2,
3)
,s.substring(
4,
5)
);
}
Edit as requested: Eclipse Version Luna Release (4.4.0)
Edit your formatter, tab "Line Wrapping" -> "Function Calls" -> "Arguments" and chose:
Line wrapping policy: Wrap all elements, every element on a new line
Force split: No
Indentation policy: Default Indentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With