This is annoying problem I'm having in VS2010, is there anyway I can expand and contract conditional statements and loops, as if they were methods? I realize the answer might be that I should be refactoring them out into methods if I get to this point, but humor me anyway. I thought I was once able to do this.
Edit, an example:
public void DoSomething()
{
if (1 < 2) {
// long statement here
}
}
In the left gutter of VS2010, I can contract "DoSomething" ... I cannot, however, contract the if/then statement.
http://social.msdn.microsoft.com/Forums/en-US/vssetup/thread/73948b75-2db6-4662-80fa-5f2ace372a3b/
You can go to Tools menu -> Options. Then go to Text Editor -> C/C++ -> Formatting. Turn the Outline Statement Blocks to true.
There's a VS 2010 plugin that does just that: http://visualstudiogallery.msdn.microsoft.com/4d7e74d7-3d71-4ee5-9ac8-04b76e411ea8
Not automatically, as with a method, but select some lines and choose Edit, Outlining, Hide Selection. You can then expand/collapse at will. Stop Hiding will take away the +/- symbol.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With