Matti-Koopa
Matti-Koopa

Reputation: 278

ReSharper Auto-Inserts braces on "else"

This question is similar to this one: Stop VS 2010 from Auto Creating Braces After else keyword But I can't comment on there and it's not really solved.

Basically, ReSharper inserts { } on pressing enter after an "else".

I tried everything and even changed the ReSharper option "Braces in 'if-else' statement" to "Remove braces". Doesn't do anything. Disabled both options under "Braces and Parenthesis" in "Editor Behavior" - nothing.

The solution for the question linked above said to disable auto-complete. I haven't found an option to do this.

I'm using VS 2013 and ReSharper 6.0.20141219.

Upvotes: 5

Views: 579

Answers (2)

Lukas Matyska
Lukas Matyska

Reputation: 113

I cannot comment for Piers Myers answer, so I paste new answer.

The Reharper Templates Explorer can be also found under Resharper->Tools->Templates Explorer...

Disabling else template works for me (ReSharper Ultimate 2017.3 on VS 2017).

Upvotes: 2

Piers Myers
Piers Myers

Reputation: 10899

Open the Reharper Templates Explorer (Resharper->Templates Explorer...), select the C# scope and then deselect the 'else' template.

(This was using Resharper 8.2.3 and Visual Studio 2013)

Upvotes: 2

Related Questions