How to make ReSharper always put the first parameter on the same line as the method?

In ReSharper, I have "Wrap Long Lines" and all the "Wrap Parameters" parameters are set to "Chop if long".

If I have a line of code like this:

DisplayMessage("This is a really long string that cuts off the screen ...", type, item);

ReSharper wants to format the string as follows:

DisplayMessage(
    "This is a really long string that cuts off the screen ...",
    type,
    item);

But I want it to format it like this:

DisplayMessage("This is a really long string that cuts off the screen ...",
               type,
               item);

Is it possible? I understand that this is because of the long line as the first parameter, so she wants to put it in her line, but I prefer the changed parameters to match the opening bracket.

I like the option [ ] Don't put the first parameter on its own line.

+4
source share
1 answer

The checkbox you are looking for is located on:

Code editing -> C# -> Formatting Style -> Line Breaks and Wrapping -> Line Wrapping

and named

Prefer wrap after "(" in invocation

and you want him

( Resharper 2016.2.2 build 13-Sept-2016 )

+1

Source: https://habr.com/ru/post/1651421/


All Articles