Abdu
Abdu

Reputation: 16585

remove regions in visual studio

Ctrl M-L doesn't toggle all the regions in vb.net (2008) when there's a hierarchy between the regions. I don't like regions. Is there a way to expand ALL the regions or remove them permanently?

Upvotes: 1

Views: 1231

Answers (3)

John Cruz
John Cruz

Reputation: 1592

In VB.Net, do a Search and Replace and select Use Hidden and Use Regex:

Replace:

^.*\#(end)*(:Wh)*region.*\n

With:

Upvotes: 3

Bernhard Hofmann
Bernhard Hofmann

Reputation: 10411

There is a claim by James Nies that "NArrange could also be used as a tool to strip regions from source code."

I hadn't thought about it until now, but NArrange could also be used as a tool to strip regions from source code.

If you were to define an empty elements declaration for types, see below, then NArrange will just parse the members and write them back. It won't sort anything, but rather will just strip regions and clean up whitespace between members.

 <Element Type="Type" Id="DefaultType">
     <Elements>
         <Element>
              <Elements />
         </Element>
     </Elements>
 </Element>

However, this won't remove regions that are defined within members.

Source: http://www.codeproject.com/KB/codegen/narrange.aspx?msg=2579903#xx2579903xx

Upvotes: 1

Frans Bouma
Frans Bouma

Reputation: 8357

there's no such thing as expanding all outlining in nested outlines, Cntrl-M, L is the one to expand all outlining (or cntrl-m, cntrl-m to expand 1 region). VB.NET doesn't have an option to toggle outlining mode as C# has.

Upvotes: 0

Related Questions