When I type in a Linq query style statement like
var stuff = from x in things
group x by x.Something into g
select g;
Resharper is reformatting it to
var stuff = from x in things
group x by x.Something
into g select g;
And then complains about it because it breaks the StyleCop rule SA1103. Is this a bug in Resharper or is there some combination of settings that I need to change to keep it from doing this reformatting?
Edit
JetBrains has confirmed that this is a bug and it is fixed in version 8.0.
Looking at the options for ReSharper, there is a single option under Code Editing -> C# -> Formatting Style -> Other called "Align Multiline Constructs, LINQ query".
This appears to control the relevant formatting (disabling it causes the multi-line linq query to not align by position, but simply by tab indentation).
Based on the fact that there isn't any more granular control over what happens with into
, I'd say it's either a bug or a missed requirement on their part. Perhaps raise a ticket.
To be honest I was expecting to find something under "Line Breaks and Wrapping", but nothing was in there for linq queries.
ReSharper 7.1.1000.900 on VS 2012
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