Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReSharper LINQ extension method formatting

I'm struggling with Resharpers formatting. Consider the following Code:

product.Resources.Where(x => x.Tracked).Pipe(y =>
                                             {
                                                 //Action       
                                             });

How can I tell ReSharper to indent the part in the curly braces and the curly braces itself only a little bit? I've tried several Resharper formatting settings but none had any effect in this case.

Edit:

I would like to have a format similar to this:

product.Resources.Where(x => x.Tracked).Pipe(y =>
    {
        //Action       
    });
like image 216
Jay Avatar asked Mar 05 '12 22:03

Jay


1 Answers

See https://stackoverflow.com/a/819393/736079

You can customize ReSharper to do just that, you'll need to do the following (All in ReSharper -> Options -> C# -> Formatting Style):

  • In Braces Layout, set Array and object initializer to At Next line (BSD Style).
  • In Other, make sure that Continuous line indent multiplier is set to 1.
  • In Other, make sure that Indent array, object and collection initializer block is unchecked.

You should get the style you want.

like image 56
jessehouwing Avatar answered Sep 18 '22 17:09

jessehouwing