Braces being put on next line, even though I have set K&R style for all options - why?

Hello,

I've got a fully licensed copy of R# 6, and had set my braces layout to K&R style, so opening braces appear on the end of the line before.

Whilst trying to sort out a problem, I had to reset my VS settings, and since doing so, R# reformats my code with the opening braces on a new line, even though my R# settings show K&R style (ie braces on the end of the previous line). In fact, whatever I set these options to, it does the same with my code! It seems to ignore whatever I set here, and put the opening brace at the start of a new line.

Anyone any idea how I get it to take notice of my settings? It's really driving me mad, as I HATE having opening braces on the next line!

Thanks for any help

4 comments

Just in case it helps, I just uninstalled R# and reinstalled it, and the problem is still there.

I've just realised that it's also inserting four spaces at the start of each line when it indents. It only ever used to insert two. Can I get this back to the way it was before? Four spaces means that deeply nested constructs end up moving away from the left margin pretty quickly.

Thanks for any help

0

OK, I discovered the problem, but I'm still a bit puzzled. As i said in my first post of this monologue (:^O), I had to reset my VS settings. This of course rest VS's own options for putting opening braces on new lines. I just set these to how I want them, and it works fine (sorted out the extra indent as well).

What I don't understand is why R#'s setting didn't override the VS ones. Surely the point of R# duplicating some of the VS setting is that they will override them. There's no point in R# having these settings if the VS options are goign to clobber them.

Anyone able to explain what happened? Anyway, I'm happy again, so I can carry on work!

0

Hello Yossu,

I'm afraid ReSharper cannot override Visual Studio formatting settings in
this case. In order to avoid this behavior just turn off all 'Automatically
format ...' options under Tools | Options | Text Editor | C# | Formatting
| General, so that it doesn't get in the way. Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

OK, I discovered the problem, but I'm still a bit puzzled. As i said
in my first post of this monologue (
), I had to reset my VS settings. This of course rest VS's own options
for putting opening braces on new lines. I just set these to how I
want them, and it works fine (sorted out the extra indent as well).

What I don't understand is why R#'s setting didn't override the VS
ones. Surely the point of R# duplicating some of the VS setting is
that they will override them. There's no point in R# having these
settings if the VS options are goign to clobber them.

Anyone able to explain what happened? Anyway, I'm happy again, so I
can carry on work!

---
Original message URL:
http://devnet.jetbrains.net/message/5308611#5308611



0

Please sign in to leave a comment.