I've noticed that in Visual Studio 2017, when I hit CTRL+M, CTRL+O, regions do not collapse to definitions. Has there been a change on this? How do I collapse everything -- including regions?
BTW, I get the same results whether I use the keyboard shortcut or go through the context menu by right-clicking. Regions just do not collapse at all.
(Ctrl+M, Ctrl+H) - Collapses a selected block of code that would not normally be available for outlining, for example an if block. To remove the custom region, use Stop Hiding Current (or Ctrl+M, Ctrl+U). Not available in Visual Basic.
CTRL + M + O will collapse all. CTRL + M + P will expand all and disable outlining. CTRL + M + M will collapse/expand the current section. CTRL + M + A will collapse all even in Html files.
Ctrl + Shift + [ on Windows and Linux. ⌥ + ⌘ + [ on macOS.
Here's how to assign a keyboard shortcut to collapse all projects in Visual Studio Solution Explorer. In Visual Studio, go to Tools > Options > Keyboard. In the Show commands containing text box, type in CollapseProjects.
It seems that this behavior is turned off by default. It can be enabled under Tools > Options > Text Editors > C# > Advanced > Outlining > "Collapse #regions when collapsing to definitions"
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