‘Collapse All’ in Visual Studio

We have tons of sub-folders in our main client project, and every time you access a file in a sub-folder Visual Studio expands the sub-folder, and given how many files we have in these sub-folders, the scroll bar quickly becomes a tiny dot.

Once their open, there’s no easy way to collapse them all except to go through by hand and manually collapse each one again.

The Visual Studio team gave me the following reply to my suggestion for a “Collapse All” ¬†feature:

Posted by Microsoft on 3/29/2010 at 2:10 PM
Thanks for your feedback. This is a good suggestion and one that we unfortunately cannot incorporate in VS2010. However, here is a macro that should help in the meanwhile:

    Sub UIHierarchy_CollapseTree()
        Dim Hierarchy As UIHierarchy

        'Change Hierarchy to the following line to collapse the active window
        'Hierarchy = DTE.ActiveWindow.Object
        Hierarchy = DTE.Windows.Item(Constants.vsWindowKindSolutionExplorer).Object

    End Sub
    Sub CollapseHierarchyItems(ByVal HierarchyItems As UIHierarchyItems)
        Dim SubHierarchyItem As UIHierarchyItem
        For Each SubHierarchyItem In HierarchyItems
            SubHierarchyItem.UIHierarchyItems.Expanded = False
    End Sub

OpenMP joy from Visual Studio :)

An update from my earlier post, I got a reply to my OpenMP 3.0 ticket, for those of you who don’t have a Windows Live account:

Hopefully that means it’ll be in VS 2010 by release time. Superb.

<3 Visual Studio, yet again :)