66

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.

Sam
  • 26,817
  • 58
  • 206
  • 383
  • I'm not having this problem. Try checking your keyboard shortcuts - Edit.CollapsetoDefinitions. Maybe you have a different command mapped to that. – HaveSpacesuit Mar 16 '17 at 19:36
  • As I mentioned, I get the same behavior if I use the context menu so it's not keyboard mappings. I do have a few minor issues with Visual Studio 2017 and looks like this is one of them. – Sam Mar 16 '17 at 19:47
  • Have you tried activity log? Is there error when you collapse region via context menu? – qxg Mar 17 '17 at 09:42

1 Answers1

121

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"

Gelásio
  • 1,899
  • 1
  • 19
  • 18