2 Replies Last post: Oct 31, 2013 1:22 PM by Hronom  
Hronom Newbie 2 posts since
Oct 30, 2013
Currently Being Moderated

Oct 30, 2013 9:10 PM

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?

Mark Vedder Apprentice 1,006 posts since
Dec 10, 2003
Currently Being Moderated
Oct 30, 2013 10:54 PM in response to: Hronom
Re: New line before '('

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

More Like This

  • Retrieving data ...