Collapse Selection in Solution Explorer – Extension #7


Recursively Collapse Nodes in the Solution Explorer!

The Visual Studio IDE team has heard a lot of feedback asking for a way to recursively collapse nodes in the solution explorer. For example, right out of the box, when you collapse a node in Solution Explorer, it only collapse just that node. But, what if you want to collapse all sub-nodes at the same time? Then you’ll want to install the Collapse Selection in Solution Explorer extension.

To Install

The extension can be found on the Visual Studio Gallery at http://visualstudiogallery.msdn.microsoft.com/en-us/cb0ec47d-05a4-40a7-ba39-9a2da6492f1c

To Use

Once installed, you’ll see a new button in the Solution Explorer toolbar. This button will recursively collapse the selected node or nodes (note: you can multi-select different nodes to recursively collapse at the same time.)

node with lots of sub nodes expanded

Now when we collapse and expand the TestApp project, we’ll see the sub-nodes also collapsed.

node with sub nodes collapsed

And the keyboard shortcut is Ctrl+Alt+Num(-)

More Info

You can read more about this extension on the VS IDE team’s blog. http://blogs.msdn.com/visualstudio/archive/2010/05/13/announcing-collapse-selection-in-solution-explorer-extension.aspx

Comments (4)

  1. Great Tip!  Having to collapse each section has always been a pain.  I’ve been using vs2010 for a while and did notk now about this.    THANKS Sara!

  2. Todd says:

    On most other programs i’ve used ctrl + expands all and ctrl minus collapses all. Just wondering if I could vote for those keystrokes instead. If I can map the keys myself then nevermind.

  3. Jim White says:

    Awesome!  Something I've wanted for years.  Why the VS team wastes time on stupid features I don't know.

  4. Pavan Adharapurapu says:

    Hi Todd,

    You can change the keyboard binding to whatever you wish, as long as it is not already taken. Just go to Tools > Options > Environment > Keyboard and type View.CollapseSelectionInSolutionExplorer in the "Show commands containing" field. This should bring up this command in the pane below. Select it. Then type whatever key binding you want in the "Press shortcut keys" text box. Make sure that this keystroke is not taken (if it is then the "Shortcut currently used by" field would show which command uses it). Finally, press the "Assign" button to assign this new keystroke. Note that Ctrl + Num(+) and Ctrl + Num(-) seem to have been already taken by the workflow designer, so you may want to use something else. If you don't use the Workflow designer at all, then you may consider overriding those commands.

    Thanks,

    Pavan Adharapurapu

    Software Developer,

    Microsoft