tina nyaa
tina nyaa

Reputation: 1021

Resharper code indenting configuration

Resharper currently formats my code to:

myField1 = expression1 +
    expression2 +
        expression4 +
            expression5 +
                expression6;

if (expression1 
        || expression2
            || expression4
                || expression5
                    || expression6
                        || expression7)
{
}

How do I change the behaviour to something like:

myField1 = expression1 +
    expression2 + expression3 +
    expression4 +
    expression5 +
    expression6;


if (expression1 
    || expression2
    || expression4
    || expression5
    || expression6
    || expression7)
{
}

Thank you!

Upvotes: 1

Views: 226

Answers (3)

Dmitry Osinovskiy
Dmitry Osinovskiy

Reputation: 10128

By the way, stairs-like formatting is fixed in ReSharper 7.0 EAP.

Upvotes: 0

Răzvan Flavius Panda
Răzvan Flavius Panda

Reputation: 22126

From the menu:

Resharper -> Options...

Go to:

Languages -> C# -> Formatting Style -> Other

And check:

Align Multiline Constructs -> Expression

Upvotes: 3

MortenRøgenes
MortenRøgenes

Reputation: 696

Under Options-Code Editing, there is options for aligning multiline constructs. One of them are Expression, which you could enable to get the behaviour you want

Upvotes: 1

Related Questions