I’m going to file this one under Stupid Visual Studio tricks.
When editing a master page file in an ASP.NET project (or in my particular case, a SharePoint solution), it came clear that the normal display of the HTML source was missing the very useful expand/collapse option.
Exhibit 1. Master page with no collapse
With a hat tip to this Stackoverflow post, it appears re-opening the file and explicitly selecting the editor to use fixes this behavior, as shown below. (Note, I’m basing this on VS2010 SP1. YMMV.)
Then select Master Page Editor (which is probably already marked as default) and click OK.
Then watch your cursor spin while some Visual Studio voodoo magic happens. When the file opens, you should see the expand/collapse boxes and lines.
The epic fail part comes when Visual Studio makes you do this every time you open the file.
It is worth noting, however, that .aspx and .ascx pages are exempted from this