Is it possible to configure resharper to chop all methods in a method chain
e.g.
var query = list.Where(x => true).Select(x => x);
becomes
var query = list
.Where(x => true)
.Select(x => x);
If not, then is it possible to configure resharper to ignore method chains when formatting? So I can chop the text manually without having to worry about resharper re-formatting it.
Unfortunately, there is no way to align .Where
under list
.
As for chopping, there is an option in ReSharper | Options -> Code Editing | C# | Formatting Style | Line Breaks and Wrapping -> Line Wrapping
called Wrap chained method calls
. If you set it to Chop always
, it would chop, but it uses a slightly different formatting:
var query = list.Where(x => true)
.Select(x => x);
If you leave it to Chop if long
(default value), then it wouldn't re-chop your code unless it would be very long (more than Right margin
option, which is in the same option group mentioned above).
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