Problem with Visual Studio 2010 + resharper

I am using VS 2010 + resharper and I am tired of reformatting the indentation in parentheses in the code as I want it. As an example, if I have code like:

operators.Keys .ToList() .ForEach(k => filters .AddRange(CustomHtmlHelpers.GetIdAndValueListByPrefix(queryString, k) .Select(t => new QueryFilter() { Operation = operators[k], PropertyName = t.Item1, Value = t.Item2 }))) 

And if I put ; at the end of VS (or resharper) "fixes" the indent in parentheses, the code will look like this:

 operators.Keys .ToList() .ForEach(k => filters .AddRange(CustomHtmlHelpers.GetIdAndValueListByPrefix(queryString, k) .Select(t => new QueryFilter() { Operation = operators[k], PropertyName = t.Item1, Value = t.Item2 }))); 

The same thing happens if I use override code cleanup. I probably could have disabled the automatic formatting of the code on ; but I need it in other situations. I tried changing the code formatting options in both VS and resharper settings, but never got indented as I want it.

How can I configure vs or resharper so that it does not do more than one tab layout? Or maybe there is another plugin that I can use (along with r #) specifically for this purpose?

EDIT: for anyone interested in this issue, the same question arises here in the r # forum http://devnet.jetbrains.net/thread/304794 anyone who would like to see the best nested code indent from r # can vote for it here http://youtrack.jetbrains.net/issue/RSRP-88220

+8
code-formatting c # visual-studio-2010 brackets resharper
source share
1 answer

just guessing ...

go to ReSharper -> options -> Code Editing -> C # -> Formatting Style -> Other

Find in Align Multiline Constructs and try to toggle the state of the Call Chains checkbox (I assume your value is "checked" for this checkbox).

If not this one, I expect the required setting is somewhere very close :-)

+1
source share

All Articles