How to configure formatting to preserve indentation

I would like to preserve the following indentations whenever I run code cleanup to format my code (I hope this post preserves my indentation!)


public void TestInitialise()
{
StatesCriteriaFor = new ViewStatesCriteria(); StatesCriteriaFor .TextBox(() => PresentationModel.CompanyAddress1Edit) .LockedIn(HostInputState.Initial) .ReadonlyIn(HostInputState.Initial) .Button(() => PresentationModel.PreviousButton) .InvisibleInAllStates() .DisabledInAllStates() .Button(() => PresentationModel.NextButton) .InvisibleIn(HostInputState.Initial) .DisabledIn(HostInputState.Initial, HostInputState.Invalid) .PickList(() => PresentationModel.LeadHostTypeList) .LockedIn(HostInputState.Initial); } Currently when I run the code cleanup all the method calls line up in a single block which is definetely what I do NOT want: StatesCriteriaFor = new ViewStatesCriteria(); StatesCriteriaFor .TextBox(() => PresentationModel.CompanyAddress1Edit) .LockedIn(HostInputState.Initial) .ReadonlyIn(HostInputState.Initial) .Button(() =>]]> PresentationModel.PreviousButton)
....


I beleive I have accepted all the default formatting options, although I cannot be sure as I have upgraded from Resharper 3.1 where I did change some of the formatting preferences.

Please advise

Thanks in advance
Christian

3 comments

Ok, so the post did not preserve my formatting!

Try again this time with an screen print (as an attachment)



Attachment(s):
IndentationExample.JPG
0

Indentation is one of the major steps of code formatter.
To preserve your own formatting, simply don't invoke our code formatter at
all

--
Eugene Pasynkov
ReSharper Technical Lead
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


"Christian Crowhurst" <no_reply@jetbrains.com> wrote in message
news:16861402.117361226481101489.JavaMail.jive@app4.labs.intellij.net...
>I would like to preserve the following indentations whenever I run code
>cleanup to format my code (I hope this post preserves my indentation!)
>


public void TestInitialise()
{
StatesCriteriaFor = new ViewStatesCriteria<HostInputState>();
StatesCriteriaFor
.TextBox(() => PresentationModel.CompanyAddress1Edit)
.LockedIn(HostInputState.Initial)
.ReadonlyIn(HostInputState.Initial)
.Button(() => PresentationModel.PreviousButton)
.InvisibleInAllStates()
.DisabledInAllStates()
.Button(() => PresentationModel.NextButton)
.InvisibleIn(HostInputState.Initial)
.DisabledIn(HostInputState.Initial, HostInputState.Invalid)
.PickList(() => PresentationModel.LeadHostTypeList)
.LockedIn(HostInputState.Initial);
}

>

Currently when I run the code cleanup all the method calls line up in a
single block which is definetely what I do NOT want:

>

StatesCriteriaFor = new ViewStatesCriteria<HostInputState>();
StatesCriteriaFor
.TextBox(() => PresentationModel.CompanyAddress1Edit)
.LockedIn(HostInputState.Initial)
.ReadonlyIn(HostInputState.Initial)
.Button(() => PresentationModel.PreviousButton)
....

>
>

I beleive I have accepted all the default formatting options, although I
cannot be sure as I have upgraded from Resharper 3.1 where I did change
some of the formatting preferences.

>

Please advise

>

Thanks in advance
Christian



0

Mmm, I surely can't be the only one wanting to do this type of "fluent interface" coding so therefore want control over indentation, but still wanting to use resharper code formatting to do the sensible thing with the rest of the code??

I suppose want I'm asking for is the addition of another formatting preference option that I can define that allows me to preserve indentation for "fluent interface" method chaining statements. Do you think this is a viable feature? If so how what do I need to do to officially request this feature?

Thanks
Christian

0

Please sign in to leave a comment.