Collapse to Definitions with Outlining

Tips Search

Collapse to Definitions with Outlining

  • Comments 8

Keyboard:  CTRL + M, CTRL + O
Menu:  Edit -> Outlining -> Collapse to Definitions
Command:  Edit.CollapsetoDefinitions
Versions:  2008,2010
Published:  3/18/2010
Code:  vstipEdit0032

 

One of the coolest features of Outlining is the Collapse to Definitions.  This feature will collapse the areas for all members.  So if you have code like this:

image

 

You can press CTRL + M, CTRL + O or go to Edit -> Outlining -> Collapse to Definitions on your Menu Bar to get this:

image

  • Great skill, save me lots of time in the future

  • That's a useful feature, but it doesn't seem to work with ashx files.

  • The opposite process is very useful sometimes. Thus, if you need, you can "uncollapse" all definitions by clicking on CTRL + M + P. That is, use P instead of O.

  • @Txarlie: your comment is more usefull... thanks

  • This feature is awesome and I loved in it 2010, but now in 2012 the behavior has changed and comment blocks that appear before a method now collapse as well making it annoying -- you can't read a multi-line comment block above a method any longer with this feature.  Is there some reason this was changed or could there please be an option to bring back the previous behavior which left multi-line comments above a definition there?!

    ex:

    // This is a comment for this method.

    // This method should be called when xyz happens.

    void DoFoo()

    {

    }

    In 2012 the two comments will collapse into an unreadable  /* ... */ tag.

  • Hey Doug :)

    In cases where things change betweeen versions like that the team will usually restore the old way in one of the updates.  I'm not sure where this is on the list of priorities so can't say when they will fix it but I'm pretty sure it is on the product backlog.

    Z

  • I was looking for this feature in VS2013, but it simply worn't work (not even if I manually execute it with Outlining->Collapse... from menu)

  • Same as @Daniel here.  It doesn't run on VS2013 + Update3

Page 1 of 1 (8 items)
Leave a Comment
  • Please add 8 and 3 and type the answer here:
  • Post