Sarov
Sarov

Reputation: 645

How to make ReSharper stop removing blanklines in my invocations?

In my repository code, I sometimes use blank lines to separate parameters into groups of 5 so that it's easier to eyeball that the ?s match the parameters. Like so:

var sql = $@"
UPDATE MYTABLE SET
MYPROP1 = ?
, MYPROP2 = ?
, MYPROP3 = ?
, MYPROP4 = ?
, MYPROP5 = ?

, MYPROP6 = ?
, MYPROP7 = ?
...
, MYPROP29 = ?
, MYPROP30 = ?

, MYPROP31 = ?
WHERE ID = ?";
var parameters = DBParametre.GetParms(
    1,
    2,
    3,
    4,
    5,

    6,
    7,
...
    29,
    30,

    31,

    id
);

The problem is, when I run ReSharper Cleanup Code in the repository file, it removes the blank lines in the middle of the GetParms() invocation. How do I make that stop?

Upvotes: 0

Views: 29

Answers (1)

Piers Myers
Piers Myers

Reputation: 10899

According to the ReSharper help, you can use the following comments:

// @formatter:off — disable formatter after this line

// @formatter:on — enable formatter after this line

Upvotes: 1

Related Questions