ReSharper LINQ extension method formatting
-
07-12-2019 - |
Domanda
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
});
Soluzione
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.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow