Reputation: 33318
Resharper's code formatting is generally fine, but it seems completely broken when dealing with very long lines. For example look at this piece of code:
I do want some kind of line wrapping, but it should look ahead and indent less if necessary to avoid ridiculous amounts of line breaks. Something like this would be great:
Is there any way to make Resharper do this?
Upvotes: 7
Views: 3147
Reputation: 33318
Alex Berezoutsky of Jetbrains has suggested to turn off "Indent array, object and collection initializer" checkbox in the "ReSharper | Options | Languages | C# | Formatting Style | Other" dialog. It's not ideal IMO for shorter lines, but it does look much better on very long code lines.
I guess it's the best workaround for this problem at the current time.
Upvotes: 2
Reputation: 13641
I admittedly haven't plugged your code into my IDE to try it so I don't have exact setting values for you, but have a go at tweaking the line wrapping options in R# options.
Upvotes: 0