how to get 'zero' bracket indentation?

VS 2010, R# 5.0

I like doing delegates/lambdas inline, with brackets, but with 'zero' indentation (relative to the start of the method call), so something like:


     DoSomeMethod(param1, param2, () =>
     {
          if (foo)
          {
               // blah
          }
     });

However, I don't see any of the indentation options that seem to match this - the best I can seem to do is BSD, which indents the least, but is still indented to the param column.

I'd imagine this is doable, but I'm too unfamiliar with R# at the moment to know how to get from here to there

Thanks!     

2 comments
Comment actions Permalink

Hello James,

Open ReSharper > Options > Languages > C# > Formatting Style > Other and
turn off 'Indent anonymous method body' option. Thank you!

Andrey Serebryansky
Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

VS 2010, R# 5.0

I like doing delegates/lambdas inline, with brackets, but with 'zero'
indentation (relative to the start of the method call), so something
like:

DoSomeMethod(param1, param2, () =>
{
if (foo)
{
// blah
}
});
However, I don't see any of the indentation options that seem to match
this - the best I can seem to do is BSD, which indents the least, but
is still indented to the param column.

I'd imagine this is doable, but I'm too unfamiliar with R# at the
moment to know how to get from here to there


Thanks!

---
Original message URL:
http://www.jetbrains.net/devnet/message/5265044#5265044



0
Comment actions Permalink

Open ReSharper > Options > Languages > C# > Formatting Style > Other and
turn off 'Indent anonymous method body' option. Thank you!


Wow, sorry I missed that!  Thanks, Andrey!  Chalk another one up for PEBKAC

I was unfortunately looking for it under ReSharper > Options > Languages > C# > Formatting Style > Braces Layout as one of the drop-down options under Braces Layout > Anonymous method declaration, but now I (finally) realize the boolean indentation choice is orthogonal to the bracing style chosen.  I think I got too hung up on seeing the preview difference between GNU and BSD and thinking "ok, like that, just keep going to the left! what option is that?!?"

Thanks again!

0

Please sign in to leave a comment.