visual-studiovisual-studio-extensionscode-folding

How can I quickly collapse all code in all .cs files in a project?


Currently, if I want to collapse all the content of all my .cs files in a project, I have to open each file individually and press CTRL + M, A. This process is quite tedious and time-consuming.

Is there a faster way to collapse all the code across all files in a project?

I’d prefer not to write a custom Visual Studio extension since I’ve never created one before and would rather focus on other tasks right now. However, if it’s a relatively simple and straightforward process, I’d be open to giving it a try.

Specific questions:

  1. Is there an existing extension that offers this functionality?
  2. Are there alternative shortcuts or semi-automatic methods to achieve this?
  3. Could it be done via terminal command, perhaps with Open in Terminal or a similar approach?

Any guidance or suggestions would be greatly appreciated!

Edit: opened a ticket


Solution

  • Is there a faster way to collapse all the code across all files in a project?

    I'm afraid not. Looks like there are no built-in keyboard shortcuts or menu command to achieve it up to now after do some searching.

    I would suggest you could raise a feature request. That will allow you to directly interact with the appropriate product group, and make it more convenient for the product group to collect and categorize your suggestions.