开发者

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.In开发者_JAVA技巧itial)
{
}

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.


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜