Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I force ReSharper to always put the first parameter on the same line as the method?

In ReSharper, I have "Wrap Long Lines" on, and all "Wrap Parameters" options 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 line like this:

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 this possible? I realize that it's because of the long string as the first parameter, so it wants to put it on its own line, but I prefer chopped parameters to be in line with the opening parenthesis.

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

like image 404
qJake Avatar asked Aug 16 '16 14:08

qJake


1 Answers

The check box you are looking for is placed on:

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

and named

Prefer wrap after "(" in invocation

and you want it off

(Yet my Resharper displays 2016.2.2 build 13-Sept-2016 as its version)

like image 52
Rafal Avatar answered Nov 09 '22 22:11

Rafal