5 Replies Last post: Jul 16, 2013 4:54 PM by Richard Deeming  
Matthias Müller Newbie 3 posts since
Jul 15, 2013
Currently Being Moderated

Jul 15, 2013 11:21 AM

Forcing not to intend anonymous functions

Hello There,

 

I'm not sure if this is even possible, so far I didnt find anything in the internet:

We'd like not to intend our anonymous functions, at the moment it looks like this:

        FacadeProxy.CallFacade<IAddress>(ctx =>
            {
                //DoSomething
            }

We'd like to format it like this:
        FacadeProxy.CallFacade<IAddress>(ctx =>         {             //DoSomething                  }


Is this possible? Normally the intending is fine, but at this cases it can become really annoying.


Thanks for your response and a good start in the new week!


Matthias
Richard Deeming Novice 142 posts since
Oct 6, 2010
Currently Being Moderated
Jul 16, 2013 3:07 PM in response to: Matthias Müller
Re: Forcing not to intend anonymous functions

From your example, I assume you mean "indent" rather than "intend"?

 

There's a post on the blog which suggests  that this will be improved in R# 8:

One common complaint about ReSharper’s default settings was that certain constructs we indented, shall we say, aggressively. The two particular cases of note are anonymous lambdas
...
These and similar cases will now be treated more gently by ReSharper’s default settings.

Richard Deeming Novice 142 posts since
Oct 6, 2010
Currently Being Moderated
Jul 16, 2013 4:42 PM in response to: Matthias Müller
Re: Forcing not to intend anonymous functions

Try un-ticking: R# Options -> Code Editing -> C# -> Formatting Style -> Other -> Align Multiple Constructs -> Anonymous Method Body

Richard Deeming Novice 142 posts since
Oct 6, 2010
Currently Being Moderated
Jul 16, 2013 4:54 PM in response to: Matthias Müller
Re: Forcing not to intend anonymous functions

I don't think VS has an option to do that.

 

You could try using R#s "Manage Options -> Import/Export Settings" to copy the code formatting settings from the machine that's working to the one that's not.

More Like This

  • Retrieving data ...