Skip to content

Feature request: Allow the user to collapse marked regions of code #5152

Open
@samcan

Description

@samcan

Justification
In large projects, the amount of code in each class can get unwieldy. For example, in one class I have a large number of defined properties which overwhelm the subs/functions in the class. Visual Studio/C# allows the user to mark certain areas of code as a named region which they can then collapse in the editor window to hide from view when working on other areas.

Right now I'm marking the areas using the following syntax:
'#Region Properties and '#EndRegion

But would love the ability to collapse these named regions.

Description
In the VBE, the user should be able to mark a certain region of code with '#Region <NAME> and '#EndRegion where <NAME> is the user's name for that particular region of code. This adds a collapse button next to that region of code which the user can then click to collapse it, showing only the region's name along with an expand button. The user can then click the expand button to show the region of code.

Additional context
Following is a screenshot showing collapsed regions in C#. This is a screenshot from the Visual Studio Marketplace.

I searched the issues database to see if anyone had already suggested this, but couldn't find anything. My apologies if this is a duplicate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionenhancementFeature requests, or enhancements to existing features. Ideas. Anything within the project's scope.status-deferredThere is no way to implement this right now, but the team wants to do it.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions