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.
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.
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.
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.
updated to the latest version 1.5
much much better, i like how fast it works. much better then a macro.
in my solution i got several nested solution folders and while collapsing the solution not all projects and folders collapsed.
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.
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
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'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.
here are the two macros i use today, they both work PERFECT (but bit slow)!
first - locate file in solution explorer:
Public Sub LocateFileInSolutionExplorer()
second - collapse the solution explorer tree:
' 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
' 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
' 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.DTE.SuppressUI = False
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
If innerItem.UIHierarchyItems.Expanded Then
innerItem.UIHierarchyItems.Expanded = False
If innerItem.UIHierarchyItems.Expanded = True Then
' Bug in VS 2005
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.