I know VS code folding issues are an old chestnut, but I haven't been able to find this in all the other discussions I have browsed through:
We have a team of C# guys, some love regions and others hate them and we don't seem to have much middle ground to work with.
Is there a plug- or add-in for VS that will just 'hide' the regions? So that those that want them will see them as normal, but the people that install the add-in and view a .cs file the regions just aren't there, as if they don't exist.
I can see this might be an issue when moving code around that it might cause issues of certain methods being in or outside of the wrong region, but that might be a tradeoff the team is happy with...
(Ctrl+M, Ctrl+P) - Removes all outlining information for the entire document. (Ctrl+M, Ctrl+U) - Removes the outlining information for the currently selected user-defined region. Not available in Visual Basic. (Ctrl+M, Ctrl+O) - Collapses the members of all types.
The #Region directive enables you to collapse and hide sections of code in Visual Basic files. The #Region directive lets you specify a block of code that you can expand or collapse when using the Visual Studio code editor. The ability to hide code selectively makes your files more manageable and easier to read.
CTRL + M + O will collapse all.
I hate regions (my team loves them) and was surprised to find that nobody has written an extension to make them better. I finally wrote one myself called I Hate #Regions:
Make #regions suck less (for free):
http://visualstudiogallery.msdn.microsoft.com/0ca60d35-1e02-43b7-bf59-ac7deb9afbca
There are shortcut keys to deal with them:
Ctrl+M, Ctrl+M Collapse or expand the block you're currently in. Ctrl+M, Ctrl+O Collapse all blocks in the file Ctrl+M, Ctrl+L Expand all blocks in the file Ctrl+M, Ctrl+P Stop outlining mode. (Ctrl+M, Ctrl+O resumes)
See The Problem With Code Folding
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With