Is there a way to collapse all blocks of C # code while ignoring #region definitions?

There is a wealth of documentation on the various VS hotkeys for controlling the functionality of the code editor. However, I have not found a single function (either a hotkey or similar in the menu) that will allow me to collapse all methods and ignore all sections #region

, leaving them blank.

In my case, I am managing numerous old code files that sometimes consist of more than 10k-locs. I didn't write this code, and most of the methods are organized into C # preprocessor regions. When I execute Collapse All, I see a list of 20-30+ code regions collapsed along with their methods and properties defined within them. If I want to scan all the methods and properties of a document, I need to expand every single region. This gets tedious, especially when you have to navigate from file to file, each the same size as the last.

Has anyone else had this desire and found a way to collapse all block code blocks by expanding all blocks region

? If so, how can this be done?

+3


source to share


1 answer


https://visualstudiogallery.msdn.microsoft.com/bc07ec7e-abfa-425f-bb65-2411a260b926

or



if you are using VS2012 this option is usually found on the Edit menu under Crop-> Collapse All Definitions.

0


source







All Articles