Resharper redefines my code

I would like resharper to backtrack my code as follows:

var modification = shortUrlIndexCollection.FindAndModify ( Query.Or ( Query.And ( Query.EQ("_id", "Index"), Query.EQ("LockId", Guid.Empty) ), Query.LT("UnlockOn", now) ), SortBy .Null, Update .Set("LockId", guid) .Set("UnlockOn", now + reserveDuration), true ); 

But instead, it formats my code as follows:

 var modification = shortUrlIndexCollection.FindAndModify ( Query.Or ( Query.And ( Query.EQ("_id", "Index"), Query.EQ("LockId", Guid.Empty) ), Query.LT("UnlockOn", now) ), SortBy .Null, Update .Set("LockId", guid) .Set("UnlockOn", now + reserveDuration), true ); 

According to formatting a custom bracket using Resharper I already tried the continuous line indent multiplier parameter, but it gives incorrect results ...

+1
c # resharper
source share
2 answers

It is not possible to format ( and ) way you want it in ReSharper 7.1 or lower. We are working on introducing a new indentation system in 8.0, which will give you better control over layout () and [].

+2
source share

Try Resharper 7.1 , it fixed the indentation of chained methods.

Just tried it with style settings and formatting:

 shortUrlIndexCollection.FindAndModify( Query.Or( Query.And(Query.EQ("_id", "Index"), Query.EQ("LockId", Guid.Empty)), Query.LT("UnlockOn", now)), SortBy.Null, Update.Set("LockId", guid).Set("UnlockOn", now + reserveDuration), true); 

Not what you want.

+4
source share

All Articles