Settings for the method chain

Is it possible to configure resharper to chop all methods in a method chain

eg.

var query = list.Where(x => true).Select(x => x);

becomes

var query = list
            .Where(x => true)
            .Select(x => x);

If not, is it possible to configure resharper to ignore method chains when formatting? Therefore, I can chop the text manually without worrying about reformatting it.

+5
source share
1 answer

Unfortunately, there is no way to align .Whereunder list.

As for grinding, ReSharper | Options -> Code Editing | C# | Formatting Style | Line Breaks and Wrapping -> Line Wrappingthere is an option Wrap chained method calls. If you set it to Chop always, it will hack, but it uses a slightly different formatting:

var query = list.Where(x => true)
                .Select(x => x);

Chop if long ( ), , ( Right margin, , ).

+3

All Articles