Incorrect line breaks for compound if conditions
Hi,
I must be doing something wrong because I always get a line break for compound if conditions. I'm using VS2012 with Resharper 7.1.3 and Stylecop as the plugin.
So for example:
if (queue.TryDequeue(out element) && oldElement == null)
{
}
becomes:
if (queue.TryDequeue(out element)
&& oldElement == null)
{
}
The settings I believe should not allow this to happen are:
- Right margin: 160 (way too high value to force the lines to be choped)
- Force chop compound condition in "if" statement: off
Can anyone give me a hand with this one? Thanks.
Please sign in to leave a comment.
Hi Dan,
Could you please temporary disable/uninstall StyleCop and recheck this once again to ensure that this is ReSharper issue/setting?
Please let me know the results.
Thanks!
Found a bit more time to look at the problem. Uninstalled Stylecop but that wasn't it.
The problem is that the "computer" settings take precedence over "solution shared" settings, at least in the case of compound if conditions. This is a bug. If a solution shared setting file exists, that should take precedence.
Another issue is the fact that attempting to copy the "solution shared" settings over the "computer settings", via the manage settings screen, even if it's instructed to copy everything, ignores some settings, including the formatting options. This is another bug.
Hi,
Thanks for the info - we will look into it!