I've been using Resharper 2016 with Visual Studio 2015, and I had code formatted like this:
list.Add(new SomeClass
{
Value = 1,
Name = "some name"
});
And life was beautiful...
But after updating to Visual Studio 2017, and to Resharper 2018, suddenly after hitting ctrl + E + C, and performing built-in R# option "Reformat code", I got this:
list.Add(
new SomeClass
{
Value = 1,
Name = "some name"
});
Which is terrible, because I usually want indentation only after {
.
The only exception being single line statement like 1-liner if, where I sometimes skip the curly brace but still have indentation.
I've tried to switch all possible R# options to "simple wrap" but it didn't help. I've tried to set different values, where it made sense for me, but still no success.
Only after switching "revert to old formatting engine" it helped, but it also break other things, so that is not a viable solution for me.
If you select code and invoke with Alt+Enter "Format selection -> Configure", you'll see list of settings which affect formatting of this selection. If you still have problems, you can reset settings in menu "ReSharper->Manage Options" p.s. try uncheck "Line breacks and wrapping -> Arrangement of initializers -> prefer wrap after ( in invocation"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With