Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual studio collapsing shortcuts "not currently available"

I am baffled. The usual shortcuts worked yesterday when I left for home. Today I started the computer, opened the project, and before writing a single line of code, wanted to collapse to definitions in an aspx file. It didn't work, and the status bar shows the message

The key combination (Ctrl+M, Ctrl+O) is bound to the command (Collapse to definitions) which is not currently available

I am in normal editing mode, not in debugging. The same combination works on .cs files, but has stopped working on .aspx files. I found on the Internet posts about experiencing the same problem when updating to a new addon version, but I don't have the addons mentioned. I tried to change into design view and back but this didn't change anything.

How do I get my outlining back?

like image 498
Rumi P. Avatar asked Mar 20 '14 11:03

Rumi P.


2 Answers

The shortcuts Ctrl+M,O or Ctrl+M,Ctrl+O do not work in .ASPX files. Try Ctrl+M,L instead.

Check the Edit -> Outlining menu for available actions.

like image 122
demoncodemonkey Avatar answered Sep 30 '22 15:09

demoncodemonkey


This command is printed when all outlining regions in the file are already collapsed to definitions. For example, if you execute the command Collapse to Definitions twice, you will always get this message the second time. The same thing happens if you execute Expand All Definitions when all regions in the file are already expanded. One of the following things has happened.

  1. The language service did not report any outlining regions in the file. In C#, this always occurs if the following option is not checked:

    Tools → Options... → Text Editor → C# → Advanced → Enter outlining mode when files open

  2. The Edit.StopOutlining command was executed (Edit → Outlining → Stop Outlining, or Ctrl+M, P).

  3. All regions in the file are already collapsed.

  4. You have identified a bug in the IDE, which you should report to Microsoft Connect.

like image 44
Sam Harwell Avatar answered Sep 30 '22 17:09

Sam Harwell