resharper 5.0 bug? ‘put into using construct’ ignores user brace setting

This is about 50/50 whether it’s a bug or PEBKAC (the last ‘bug’ I mentioned on their forums was the latter), but here’s a post to doc it with sshots so I can just include a url in the forum instead of trying to figure out how to do images in their markup 🙂

So, my R# settings have everything at BSD-style braces (I was a K&R guy before my time @ MSFT, but now I’m too used to BSD style to bother switching).  In addition, the ‘braces in using’ option specifically shows that the resulting reformat (adding braces) uses BSD style (the style used in the reformat is determined by the ‘Other’ entry in the ‘Braces Layout’ section).

image

So, I have some normal IDisposable local variable and let R# add the using construct for me:

Cursor within the local var declaration (inside the ‘stream’ string)

image

hitting alt-enter to bring up the R# menu (the ‘pencil’ menu in this case)

image

Result:

image

I love what it did, EXCEPT that it added the using with K&R style braces instead of the BSD.

Now, certainly I could fix the braces myself or let R# do so when it I next do a ‘code cleanup’ and it fixes the bracing as part of that, but it’d be nice if it looked at my braces preference when it added the using 🙂

Advertisements