Curly braces autocomplete in Visual Studio 2012
Solution 1
Visual Studio 2010 doesn't do that by default (at least not in my case). Are you sure you weren't using an extension like Productivity Power Tools
This one supports VS2012: http://visualstudiogallery.msdn.microsoft.com/0e33cb22-d4ac-4f5a-902f-aff5177cc94d
Solution 2
If anyone is having this issue with VS 2013, there is a setting for this now. I just reset my VS settings and it started to complete my braces again. For me, it wasn't productivity power tools. You can turn it on/off here:
Solution 3
Productivity Power Tools for 2012 are available now which has auto-brace completion, OP was almost definitely using the 2010 version.
Productivity Power Tools for 2013
If you haven't used it before, you can turn on/off pretty much every feature it adds in options>productivity power tools.
Related videos on Youtube
aromasca
Updated on February 21, 2020Comments
-
aromasca about 4 years
Just migrated from vs10 to vs12 and it seems like the curly braces is completely broken along side with some other features like indentation in C# (?) for example type:
public static void myFunc() {
In visual studio 10 it would automatically add the closing curly brace for it. Is there some power tool or something that can fix this and give the same behavior? the Brace Completer requires to hit Enter after the function for it to add the closing braces.
Also in tools->options->text-editor->c#->formatting-> automatically format completed block on
}
is turned on by default..-
Thelonias over 11 years"tools->options->text-editor->c#->formatting-> automaticcly format completed block on }" doesn't auto-add the ending bracket. It formats the enclosed code...properly indents, etc. when you add the ending curly bracket.
-
DevDave about 11 yearsThanks, I needed this to turn off the auto brace, really annoying!
-
BrainSlugs83 about 10 yearsI have the opposite problem. It seems 2013 is doing this by default. How the hell do you turn this off!?
-
BrainSlugs83 about 10 yearsFound it, under Text Editor (no sub group, select just the parent "Text Editor" node), uncheck (or if you're crazy like the OP, check) "Automatic brace completion".
-
Pritam Zope over 8 yearsWant to create Auto Complete Brackets for RichTextBox in C#/VB then go to -- AutoComplete Brackets In C#.NET/VB .NET
-
-
aromasca over 11 yearsThanks but brace completer requires Enter to complete the curly braces which isn't the behavior I was looking for.
-
coolmine over 11 yearsI'm assuming that you were using the one on the first link which doesn't look like it's been updated for VS2012 yet. That one doesnt seem to require to press enter. "Automatic Brace Completion improves the productivity of writing code by automatically inserting the closing code construct when the opening construct is typed for VB & C#."
-
Carlos P about 10 yearsThank God, it's incredibly annoying if you're not used to working with it.
-
zastrowm about 8 yearsOkay, maybe if Visual Studio correctly returned this for search term "brace"... (it doesn't)
-
Vahid Amiri almost 8 yearsHow is this even relevant to the question??