Collapsible Code Regions

snarfblam

Mega-Ultra Chicken
Joined
Jun 10, 2003
Messages
1,832
Location
USA
User Rank
*Expert*
I love the collapsible code and regions. You can hide most of what you dont need at the moment and focus on what you are doing. I have to be honest, though. Long before I heard about it from Microsoft, the idea occurred to me, but my vision of collapsible code went further than Microsofts, and I was slightly disappointed when I got VB.Net and it wasnt all that I had imagined.

This is closer to my vision of collapsible code, and I am considering creating my own control with this functionality, but it is a shame that I will never be able to edit my VB code this way.

It is almost like a class view (with the contents limited to the file you are viewing) except that when you expand a node, the full code is displayed. (Obviously, this image is fabricated.)

7ff7196fa4faa0cbd49cb1eed480aef0.gif


The collapsed code looks much less cluttered with only the identifiers and no keywords, and the programming elements (classes, methods, etc) are still identifiable by the images. I also think it would be nice if programming structures smaller than methods could be collapsed, as displayed in my image.

Of course, this restricts you in some ways. You lose any control over white spaces beyond the ability to add blank lines. This might drive a C++ programmer insane. But overall, this would be my ideal code editor.
 
marble_eater said:
This might drive a C++ programmer insane.
Yup...pretty much. But for VB this would be absolutely perfect. The VB syntax seems to be almost taylor made for something like this. I kind of dig the tree concept, too. You could be onto a really useful and new way of using the collapsable editor interface...
 
See if you can create it and possibly either sell it as an add-in component or make it a givaway. Another alternative is to work on such a product for #Develop, which is an open source .Net IDE.

Maybe if youre successful enough MS will steal or buy your idea and incorporate it into the next Visual Studio much like many of the C# IDE changes :D
 
Youd really need to have some kind of box or something around all of those collapsible regions though, because closing things like If statements will start getting confusing once they become nested, and they start looking like Ifs without End Ifs.

Otherwise, I think its a good idea and I like the little icons too :).
 
Iceplug said:
closing things like If statements will start getting confusing once they become nested, and they start looking like Ifs without End Ifs.
That actually occured to me. Provided that syntax is correct, the tabbing would visually make collapsed code blocks quite evident. Granted, between keystrokes, while you edit, the syntax will not remain perfect and tabbing will not be perfect, but of course you would not want to have the regions collapsed then anyways. The [+]/[-] will bring to your attention the fact that code is collapsed at that location. And, then again, the [...] boxes would help you identify collapsed code more easily, so it is certainly something to consider.
 
Back
Top