kyrylomyr
kyrylomyr

Reputation: 12632

Methods parameters indent (configuration Visual Studio, ReSharper)

I'm using Visual Studio 2010 + ReSharper. I there any way to modify auto-indent for methods parameters (any VS2010 or ReSharper option)?

For example:

public Topology(string name, TopologyType type = TopologyType.Initial)
{
}

If I'm pressing Enter before second parameter I get next indent:

public Topology(string name,
    TopologyType type = TopologyType.Initial)
{
}

But I need next one:

public Topology(string name,
                TopologyType type = TopologyType.Initial)
{
}

I found what I need in ReSharper options (Formatting Style -> Line Breaks and Wrapping), but it works only when use Clean Code -> Refactor, not when I just typing it.

Thank you.

Upvotes: 1

Views: 873

Answers (1)

kyrylomyr
kyrylomyr

Reputation: 12632

According to documentation ReSharper can automatically reformat code only after typing semicolon or closing brace. The only way to modify auto-indent for methods parameters is to use Cleanup Code -> Reformat code.

But to simplify usage you can set Silent Cleanup Profile in the Options -> Tools -> Code Cleanup and use it with hotkey on selected code (by default Ctrl + E, F).

Upvotes: 2

Related Questions