Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to collapse all classes outlining in Visual Studio

Ctrl+M+O works really great to collapse all methods in a class however I have a hard time finding a way to collapse all classes outlining in the whole file.

One may ask - why do you have many classes in one file ? It's because I'm using MSpec and classes are my tests so I have files with tens of classes. In order to wrap my head around what is going on I often have to collapse classes one by one but that is not really efficient.

like image 467
Dawid Kowalski Avatar asked Apr 12 '12 09:04

Dawid Kowalski


People also ask

How do you collapse all sections in VS code?

How to Collapse All Regions in VS Code? To fold all the regions in your code: Enter command >fold and hit enter.


1 Answers

Ha -- well, apparently I just needed to offer a bounty before I would discover an answer minutes later.

CtrlM, CtrlL will toggle all outlining. If anything in the file is collapsed, the first time you invoke this will expand everything and then invoking it again will collapse everything. This also collapses the namespace, which is a small inconvenience, but I'll call it progress.

like image 82
Jay Avatar answered Oct 09 '22 13:10

Jay