dantey89
dantey89

Reputation: 2287

Configure Rider

Can somebody help with Rider syntax configuration? I'm trying to learn Rider to format conditions in the way where predicates always should be on a new line instead of being at the end of the previous. This is how it works now:

query.Where(item => item.NormalizedPartNumber == partIdentifier.NormalizedPartNumber ||
                                       item.EPartType == partIdentifier.EPartType &&
                                       item.TypeCd == partIdentifier.TypeCd &&
                                       item.PartConfigId == partIdentifier.PartConfigId);

while I expect to see another formating:

query.Where(item => item.NormalizedPartNumber == partIdentifier.NormalizedPartNumber 
                                       || item.EPartType == partIdentifier.EPartType 
                                       && item.TypeCd == partIdentifier.TypeCd 
                                       && item.PartConfigId == partIdentifier.PartConfigId)

As you can see '&&' and '||' should be always at a new line.

Upvotes: 2

Views: 213

Answers (1)

daremachine
daremachine

Reputation: 2788

You can do that with

Settings -> Editor -> Code Style -> C#

in detail select tab

Line Breaks and Wrapping -> Arrangementof Binary Expressions

CHECK Prefer wrap before operator in binary expression :)

Upvotes: 1

Related Questions