Collapsible Code Regions

snarfblam

Ultimate Contributor
Joined
Jun 10, 2003
Messages
2,097
Location
USA
I love the collapsible code and regions. You can hide most of what you don't 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 Microsoft's, and I was slightly disappointed when I got VB.Net and it wasn't 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.)

col.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 you're 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
 
You'd 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 it's 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