Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2015 - auto-collapse #regions and inactive code

In every version of Visual Studio up to 2013, code wrapped in #regions 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.

like image 862
Dizzy H. Slightly Voided Avatar asked May 21 '15 17:05

Dizzy H. Slightly Voided


2 Answers

Well, it looks like the auto-collapse feature works again in VS2015 Update 1, so the answer now seems to be "install Update 1."

like image 58
Dizzy H. Slightly Voided Avatar answered Sep 29 '22 19:09

Dizzy H. Slightly Voided


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.

like image 32
Andreas Sjöberg Avatar answered Sep 29 '22 18:09

Andreas Sjöberg