In VS2015 and before, Ctrl+M,O would collapse all constructors, methods, properties in a file. It would also collapse all regions.
In VS2017 it no longer collapses the regions.
I really liked the high level view that this keyboard chord produced, with collapsed regions. In VS2017 that chord will actually expand all regions too.
You can invoke Ctrl+M,L twice, but this collapses everything which makes it impossible to see anything.
Is there a way of getting the old behaviour back?
To comment code: Press Ctrl+K, then also press C while still holding the Ctrl key. To uncomment code: Press Ctrl+K, then also press U while still holding the Ctrl key. You can release the Ctrl key after pressing K, then press Ctrl+C (or Ctrl+U to uncomment), but is just easier to press the keys in succession.
Customize a keyboard shortcutOn the menu bar, choose Tools > Options. Expand Environment, and then choose Keyboard.
Ctrl + K + D (Entire document) Ctrl + K + F (Selection only) To find out which key bindings apply in YOUR copy of Visual Studio, look in the Edit > Advanced menu - the keys are displayed to the right of the menu items, so it's easy to discover what they are on your system.
CTRL + M + P will expand all and disable outlining. CTRL + M + M will collapse/expand the current section.
Seems like there's a solution for it here If I understood you right
It seems that this behavior still exists within visual studio 2017 except it is turned off by default. It can be enabled under Tools -> Options -> Text Editor -> 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