New line before '('

Hello guys!
Please help, i can't find option in 'Code Style' to get '(' on new line. Here what i mean:

public class Summator {   public static int sum
  (     int value_1,     int value_2,   )   {     return value_1 + value_2;   } }


As you can see, '(' placed on the new line, right after method name('sum').
So how i can get this?

2 comments

There is no setting for placing the opening parenthesis of a method declaration on the next line. The closest you can get would be:


public class Summator
{
    public static int sum(
        int value_1,
        int value_2
    )
    {
        return value_1 + value_2;
    }
}


using the setting from the screenshot shown below. However, with those settings, if you have (manually) put the opening parenthesis on a new line, it will retain that upon a reformat, but will indent the parameter declaration.

public class Summator
{
    public static int sum
        (
            int value_1,
            int value_2
        )
    {
        return value_1 + value_2;
    }
}


You can open a feature request asking for 1) the option to force '(' for method declarations on a new line and 2) An option to not indent wrapped method parameters in a method declaration.

The settings I used:
screenshot.png

0

Please sign in to leave a comment.