Collapse Solution

Free

Collapses every item in the Solution Explorer tool window at the solution or project level.

(27) Review
Visual Studio
2010
Download (26,488)
7/5/2012
2.0.0
E-mail Twitter del.icio.us Digg Facebook
Add to favorites
Description
Reviews (27)
Q and A (5)
Sign in to write a review
Sort by:

by Robin Masters | June 13 2013

Does exactly what I would expect.

Would be nice if it keeps the path to the current file un collapsed. But thats not a big deal since another file opens to the tree to the file when in focus :)

by Berra, Ignacio Roberto | January 31 2013

Cute! :)

by Cory E Robertson | January 30 2013

by Binori | October 17 2012

Useful! thx

by Liedtke | October 02 2012

Simple, does what I want it to do. I have a solution with 50+ projects in it. Whenever I transfer the code base between locations, VS has all projects open making it difficult to navigate the solution tree to fine the files I need to work on. Now it's just one click to find the project I want.

by sigvicious | September 19 2012

this is stupid because i want to review the reviews before installing, so this review is uninformed

by KonM | August 06 2012

Perfect!

by JimReineri | May 29 2012

Exactly what I needed. Works perfectly. Simple. Effective.

by 陈志芬 | May 18 2012

really good!specially your solution has lots of projects! thanks again.

by MohamedMansour | May 15 2012

Exactly what I need :) It would be nice if it was a bit smarter, so if all were collapsed, we could expand them. But if at lease one project was expanded, it would collapse. SOme sort of toggle.

by Andrey Ch | March 16 2012

Thank you, very nice extension! The only point - there is no Collapse menu item in the context menu for Solution folders, could you please check it?

by Kirill Osenkov - MSFT | January 11 2012

Not bad but it flickers a lot because it first collapses the children and then the parent.

"Collapse Selection In Solution Explorer" is faster because it actually collapses the parent first and then goes through the children but you don't see it.

Cory Cissell January 26 2012
| Edit |
Delete

Good point. I'll published version 2.0 which should address the flicker.

Thanks for the feedback.

by Aidiakapi | November 12 2011

by Ehsan Mohammadi | October 08 2011

by zaldar | March 04 2011

Way to go! Love this extension!

by thacker | January 27 2011

So cool! :D

by Lorver Duarte | January 10 2011

Good work! Saves a lot of time.

by Tod Olsen | August 17 2010

Nice work guys.

by Ravi Santhal | July 22 2010

Very nice extension. Saves me a lot of time. Thanks for the great work!

by JSK01 | June 16 2010

1 - 20 of 27 Items   
Sign in to start a discussion


  • NCrunch ate the shortcut key
    1 Posts | Last post August 30, 2012
    • I installed NCrunch and found it had stolen the CTRL+SHIFT+Q key binding. I removed it from Tools->Options->Keyboard but sadly it still won't work. Uninstalling and re-installing Collapse Solution hasn't helped. Even uninstalling NCrunch completely hasn't brought it back.
      
      How can I get it to reset and for CTRL+SHIFT+Q to collapse the solution again? It'd be a good idea to implement the necessary bits for Collapse Solution's keyboard bindings in the standard Visual Studio options dialog to avoid conflicts.
  • No "Collapse" contextmenu on solution folders?
    1 Posts | Last post February 01, 2012
    • When I right click a solution folder, there is no "Collapse ..." item. The only way for me to collapse solution folders is to collapse the whole solution! I am using version 2.0.0.
  • With folders
    2 Posts | Last post April 08, 2011
    • if I select a folder containing 20 projects for collapse, all folders are collapsed. How about only projects inside do that way?
      Anyway, good piece of work!
      Thanks,
      Ben
    • Anytime you select a single project (right click in Solution Explorer) just that project should collapse. If you choose a solution folder then all project (and nested files) in that folder should collapse.
      
      If that's not the behavior you're experiencing please let me know.
      
      
  • Not collapsing when there are solution folders
    21 Posts | Last post February 07, 2011
    • @Shemeshi 
      I'll take a look at the issue and post a fix.
    • I looked in the report that solution folders were not being collapsed but I wasn't able to reproduce the issue. 
      
      We tested the extension against two different solutions on two different machines. 
      
      If anyone can describe how to reproduce the problem please reply to this discussion with the steps.
      
      Thanks.
    • We identified an issue with projects nested within a solution folder. An exception was thrown if you tried to collapse a project that was in a solution folder.
      
      Version 1.4 fixes the bug.  
    • updated to the latest version 1.5
      much much better, i like how fast it works. much better then a macro.
      but still...
      in my solution i got several nested solution folders and while collapsing the solution not all projects and folders collapsed.
    • Shemeshi,
      
      Can you give me an example so I can replicate what your experiencing?  It would be helpful to know if the type of project (c#, vb, setup, etc) and the nesting order. For example, Solution->C# Project->Folder->C#Project. 
      
      If I can replicate the issue that I should be able to adjust the code to handle it. There are a few quirks in dealing with UI automation so any more info you provide would be really helpful.
      
      Thanks for your feedback.
    • OK...
      silverlight c#...
      then a mix up: solution > SL project   folder... solution > folder > folder > SL project...
      
      i noticed that everything is collapsed EXCEPT the expanded projects.
      if a project is expanded everything underneath it 
    • ... and everything above it is collapsed but he himself remain opened.
    • again...
      updated to version 1.6 (keep up the good work! it will be a great extension when stable)
      the problem remains!
      using "Collapse Project" works excellent: everything is collapsed including the project itself.
      but when using "Collapse Solution" opened projects remain opened.
    • i have a simple solution that reproduce this.
      what's your Email? i'll send it to you.
    • Let me know if version 1.6 doesn't fix the issue.
    • i've already stated this above: on version 1.6 the problem remains!
    • Cory hi,
      1 - any progress on this?
      2 - can you make an extension to "find file in solution explorer"? when clicked the solution explorer will select the file and expand its folders.
    • I'm working a new way to collapse items but updates isn't ready yet. I know that the "Is Expanded" property doesn't always work - usually when the item is nested in a solution folder. Hopefully, v1.7 will be ready by weeks end.
      
      As for the "Find Files" suggestion, it sounds like a good idea. I think it has been done already. I searched the gallery for the term "Find" and found "VS 2008 File Finder". Also, other have mentioned DPack as an alternative.
    • I have been able to recreate the issue and I am working on a fix.  
      
      Under the following solution hierarchy items in the folder or project will not be collapsed if the user selects "Collapse Solution" from the solution node context menu.
      
          Solution->Solution Folder->Solution Folder->Solution Folder->Project
      
      
    • Shemeshi, after upgrading to version 1.7 please let me know if the issue was corrected. I have a test solution with lots of nested solution folders, a dozen projects (of various types), and a variety of items in the project.  In my test, everything collapses as expected. 
      
      Thanks again for your feedback.
    • Sorry Cory,
      version 1.7 is even worse!
      "Collapse Project" is not working at all!
      "Collapse Solution" is collapsing the solution folders but the projects inside remains open!
      
      version 1.6 was better!
    • here are the two macros i use today, they both work PERFECT (but bit slow)!
      
      first - locate file in solution explorer:
      Public Sub LocateFileInSolutionExplorer()
      	DTE.ExecuteCommand("View.TrackActivityinSolutionExplorer")
      	DTE.ExecuteCommand("View.TrackActivityinSolutionExplorer")
      	DTE.ExecuteCommand("View.SolutionExplorer")
      End Sub
      
      second - collapse the solution explorer tree:
      Sub CollapseTree()
      	' Get the the Solution Explorer tree
      	Dim solutionExplorer As UIHierarchy
      	solutionExplorer = DTE.Windows.Item(Constants.vsext_wk_SProjectWindow).Object()
      
      	' Check if there is any open solution
      	If (solutionExplorer.UIHierarchyItems.Count = 0) Then
      		Return
      	End If
      
      	' Get the top node (the name of the solution)
      	Dim rootNode As UIHierarchyItem = solutionExplorer.UIHierarchyItems.Item(1)
      	rootNode.DTE.SuppressUI = True
      
      	' Collapse each project node
      	Collapse(rootNode, solutionExplorer)
      
      	' Select the solution node, or else when you click 
      	' on the solution window
      	' scrollbar, it will synchronize the open document 
      	' with the tree and pop
      	' out the corresponding node which is probably not what you want.
      	rootNode.Select(vsUISelectionType.vsUISelectionTypeSelect)
      	rootNode.DTE.SuppressUI = False
      End Sub
      
      Private Sub Collapse(ByVal item As UIHierarchyItem, ByRef solutionExplorer As UIHierarchy)
      	For Each innerItem As UIHierarchyItem In item.UIHierarchyItems
      		If innerItem.UIHierarchyItems.Count > 0 Then
      			' Re-cursive call
      			Collapse(innerItem, solutionExplorer)
      			' Collapse
      			If innerItem.UIHierarchyItems.Expanded Then
      				innerItem.UIHierarchyItems.Expanded = False
      				If innerItem.UIHierarchyItems.Expanded = True Then
      					' Bug in VS 2005
      					innerItem.Select(vsUISelectionType.vsUISelectionTypeSelect)
      					solutionExplorer.DoDefaultAction()
      				End If
      			End If
      
      		End If
      	Next
      End Sub
    • If you can please send me a sample solution to cory cissell at hotmail com. All my test cases work with version 1.7 so there must be a scenario that's not accounted for. 
      
      Thanks.
    • EXCELLENT !!!
      version 1.8 works great!!
      
      good work!
    • That's my favourite!
    • I installed the extension in VS2010 successfully, but the Collapse Solution doesn't show up in the menu. I'm using Delphi Prism in VS2010. Isn't that supported?
  • Keyboard Shortcut
    2 Posts | Last post May 19, 2010
    • Eric J Peters,
      
      Thanks for the suggestion. I'm working on adding a keyboard short-cut but I hadn't considered having it select the solution node first. That should be an easy to add. Look for it in version 1.9 which should be available by the end of next week (05/21/2010).
      
      Thanks for the feedback.
    • Version 1.9 was release today (05/19/2010). The key binding "Ctrl Shift Q" will collapse all solution items with having to select a solution node first. 
      
      There are a couple of other new features added too.  The Description has more information.