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!
Please sign in to leave a comment.
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!"
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!