Search code examples
jetbrains-iderider

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.


Solution

  • 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 :)