It doesn't work for me... I have visual Studio 2012 Express Edition and any Extensions I try to add, I keep getting the error "This extension is not installable on any currently installed products.". This is a real bummer since I was really looking forward to using this extension.
Braces indentation is disabled both in plugin, and editor settings, but braces are still indented. If auto-format (Alt + F8) is applied, indentation is fixed, but it isn't convenient. I've disabled plugin because of this. MS VS 2010 Ultimate (10.0.40219.1 SP1Rel).
Excellent plugin, does exactly what it's supposed to without bells and whistles. Only one thing bugs me, would it be possible to make it add a semicolon after the closing brace when the braces are for a class/struct/union/enum in C++?
Is there something special I need to do to "turn this on?" I start typing out an if statement with the first bracket, expecting the closing one to automagically appear, but it doesn't. I poked around Tools\Options\Brace Completion and everything is on and looks good.
The other extensions I have are hide main menu, move to region and VisualSVN.
PS Plain Text brace completion setting doesn't "stick" between VS2010 sessions. I open VS, set it, close VS, open VS again, check the setting, and it's not sticking.
UPDATE 2010-07-12: Hi Joel, thanks for getting back to me. Aaaaahhhhhh, I guess it looks like we both learned something out of this then? I guess I was just expecting to get the closing brace once I typed out the first one. Any way to put/create a setting/option for that? And no probs with the other settings page, we both got something out of this one! Thanks for the updated info. Is that "usage" info listed somewhere I just missed?
PS If you're reading this, take away two things, one, it works, and two, the author is responsive. Nice to see and thanks!
I'm using VS 2012 with C++. Even though I turn off indent braces on the Brace completion option below the C/C++ brace completion in the options, it still auto indents the closing brace on the next line when I press enter.
Is there fix available for this? Thanks for your time and efforts.
I have made some progress towards this, but properly supporting brackets and parenthesis is a bit more difficult since they tend to be nested on the same line, which is not something the extension was originally written to handle.
The extension needs to remember all the locations of all the autocompleted closing tokens (not just the most recent as it currently does) so that if you type something like this...
if (foo[1] - foo[0]) { do(something()); }
...that every time you manually type a closing token, the extension can catch that and move the cursor right one character instead of inserting a character. Since the extension only remembers one closing token at the moment, you would get something like this:
if (foo[1] - foo[0]) { do(something()); })})
It would be great if the opening brace goes down to the next line after the "enter" is clicked after typing the opening brace like how it was in VS Productivity Tools. Right now the opening brace stays in the same line. Ideally in C# like, automatically:
public void Hello1()
{
//type here
}
Whereas now it is:
public void Hello1() {
//type here
}
I think the only setting there that would handle this is the smart formatting option for C#. For other languages, the opening brace should be left where you typed it. I might be able to change that if you tell me which language(s) you want it for.
Hi Joel,
I just updated to the latest version this morning and it has broken my VS. I am not able to type any code at all and I get a popup dialog with an extension error message.
Yeah. I tried to fix a crash with mouse foward/back buttons, but I ended up introducing a crash with normal keys instead. Update again (to 1.4.2) and the problem should go away.
Since you posted a question in your review and I can't comment on that directly:
I modeled the brace completion behavior off of Netbeans which doesn't put a closing brace in immediately after you type the opening one. Instead, it activates when you type an opening brace, then press Enter right after it.
Thanks for reporting the bug with options not sticking. It looks like I accidentally switched the order of a couple things when the options page loaded, so it initialized the options form before loading the saved settings. The end result was the options page would always load to default settings, no matter what your saved settings were. It should be fixed now.
Hi Joel, thanks for getting back to me. Aaaaahhhhhh, I guess it looks like we both learned something out of this then? I guess I was just expecting to get the closing brace once I typed out the first one. Any way to put/create a setting/option for that? And no probs with the other settings page, we both got something out of this one! Thanks for the updated info. Is that "usage" info listed somewhere I just missed?
Version 1.3 added support for getting a closing brace immediately after typing the opening one. Please tell me if you find any unexpected behavior.
As for the usage info, the first line of the description says how to use it, but I decided adding a "usage" section would make it more noticeable.
In VS11 Beta, the addon adds a tab on the next line if pressing 'Enter' after your initial code. This makes it appear like a malformed JS brace set.
Example:
if(true) //'Enter' pressed here
{ // a tab gets created on the new line causing a malformed JS brace-set appearance.
//pressing 'Enter' here puts the closing brace in the proper place
}
It would be great if this little bug were fixed. So far, this is the only free addon that does brace auto-completion in VS11 Beta.
I should have added that it would be nice to see auto-completion for such things as parenthesis, etc., too. Just a couple of very minor things that make working with VS a whole lot better.
Hmm. That's not happening for me in C# on VS11. Which language are you using?
Also, I'm not very familiar with VS's extensions system, so this extension is really more of a hack. It just looks for a certain input sequence, then inserts some text and repositions the cursor. I honestly have no idea how to properly do auto-completion for parenthesis, brackets, etc. Hopefully Microsoft will release a version of the Productivity Power Tools extension for VS11 (or just finally implement those as regular features so an extension isn't needed).