Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 846
Matti-Koopa Avatar asked Sep 29 '22 18:09

Matti-Koopa


2 Answers

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)

like image 59
Piers Myers Avatar answered Oct 03 '22 01:10

Piers Myers


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).

like image 31
Lukas Matyska Avatar answered Oct 03 '22 00:10

Lukas Matyska