In every version of Visual Studio up to 2013, code wrapped in #region
s and inactive code in #if
statements are automatically collapsed when you open a C# code file for the first time, when "enter outlining mode when files open" is enabled.
I'm trying to figure out how to enable this in Visual Studio 2015 RC, but even turning on "enter outlining mode when files open" doesn't seem to have any effect. If anything, it seems that the file opens, and then VS activates outlining mode a split second later, without checking to see if anything needs to be collapsed.
Well, it looks like the auto-collapse feature works again in VS2015 Update 1, so the answer now seems to be "install Update 1."
Visual Studio 2015 does not currently have this functionality built in.
You might want to check out the I Hate #Regions extension. It can automatically expand regions when opening a file.
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