Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 folding irrelevant segments
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sl@sh
Tomato Guru

Switzerland
204 Posts

Posted - Jul 04 2008 :  09:57:38 AM  Show Profile  Reply with Quote
Probably I am asking too much, but I thought if I don't ask at all I'll never know!

I wondered whether VA would be able to 'fold' or 'collapse' certain blocks of text into hiding, similar to the Outlining feature the IDE already supplies.

What I don't like about the IDE's functionality (and in consequence, would like VAX to implement) is the following:

1. Even collapsed blocks still take one line to display. I realize there needs to be some indication of hidden text, but I really don't know why such an indicator has to take up a whole line. An alternative would be a horizontal seperator, maybe using a specific style to make it stand out a bit.

2. It's not possible to collapse an entire 'private', 'protected' or 'public' block inside a class definition. When I'm looking at a header without modifying it, I usually want to view the part that I can actually access!

3. Especially in automatically generated header files I would really appreciate the ability to hide all comments. most of the time they're not helpful anyway, just take up space and make it harder to scroll through the file and locate what I'm looking for. In those cases where I do want a comment I can just hover over the symbol and read the tooltip! (thanks to VAX). Of course I could collapse each and every block of comments, but that would leave one line for each collapsed block anyway, and anyway, I'd rather have a single switch than work my way through the whole file first. (yes I know I could 'collapse all', then 'expand' the class definition, but that might also collapse other blocks that I don't want collapsed)

I'd have more suggestions, but I'll leave it at that until someone can answer whether or not collapsing text is something VAX (or maybe VAXI?) can do.


P.S.: I just hat an idea for an alternate solution to item 2. above: The method listbox (the drop down list triggered by Alt-M) currently shows all methods of a class, but doesn't discriminate between public, protected, or private methods. Also it doesn't show attributes, typedefs (AFAIK) or constants. Would it be possible to add a small toolbar that would allow to switch between alternating views of any of the kinds of class members indicated above? E. g. three toggles for viewing public, protected, or private members (or not), more toggles for viewing methods, attributes, constants, etc. (or not).

Edited by - sl@sh on Jul 04 2008 10:05:14 AM

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jul 04 2008 :  6:43:51 PM  Show Profile  Reply with Quote
point 1
We cannot modify where the text editor of the IDE is placing the text. We can overwrite the coloring of the characters, but cannot modify where it is placing the characters.

Point 2 and 3
Do you use VA Outline?
VAssistX -> Tools -> VA Outline
It helps to understand code, and you can also collapse the blocks. VA Outline handling public, protected and private as a block, so you can collapse them. Not only /* */ but // style comment blocks are also displayed as a single line, and you can even hide them. I found VA Outline more useful, than the collapse stuff in the editor.

About P.S.
You can use VA Outline to navigate also. Alt+M was designed to list methods, VA Outline was designed to view the whole source in a very compact form (including all symbols).

I know, you are talking about code folding, but you can think about VA outline as a folded version of the code . Something like a map.
What do you think?

Edited by - accord on Jul 04 2008 7:07:46 PM
Go to Top of Page

sl@sh
Tomato Guru

Switzerland
204 Posts

Posted - Aug 04 2008 :  09:16:26 AM  Show Profile  Reply with Quote
Thanks for the answers and sorry for this belated response (that's what holidays do to you ).

I haven't considered using VA outline for this purpose. Yes, you are right in that it helps a lot when it comes to navigating around a project and finding stuff. The reason however I talked about editor folding is that it allows me to define a very specific view, with each comment folded or not folded as currently needed. Or more precisely, I can define several editor views and put them next to each other or switch as needed to get a better angle. This can be especially helpful when discussing interfaces with a colleague! (plus in such a case it is helpful to not be restricted to the smaller font size of the VA Outline window)

When I do this my goal is to view as much relevant information on one screen as possible. Most of the time I am not interested in private (and, sometimes, protected) members which may or may not be spread throughout the class. Also I am not interested in most of the comments, except for some non-trivial methods that are related to the problem at hand. Unfortunately, since usually every single method has a comment block, the definition of the class is spread out over at least twice the space normally needed, because even a folded comment takes up one line!

About the latter, if I understand you correctly, VAX does not change the text of an editor window, just it's representation. That's too bad - I thought VAX would know the contents of the whole file anyway, and thus would be able to create it's own rendered view 'from scratch'. But if that's not possible, then, as I said in the beginning, I am probably asking too much
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Aug 05 2008 :  09:18:40 AM  Show Profile  Reply with Quote
You might find this interesting:

http://www.codeproject.com/KB/macros/kingstools.aspx

One of the items it contains is start and end region for C++, so you can fold the region in the IDE. I have never tried this myself, but if it works in your IDE it might help you since you could specify regions in your header files, around private and protected members.

zen is the art of being at one with the two'ness
Go to Top of Page

sl@sh
Tomato Guru

Switzerland
204 Posts

Posted - Aug 11 2008 :  05:12:50 AM  Show Profile  Reply with Quote
I do have KingsTools installed but wasn't aware of this feature. I tried it and first didn't get it to work, but when I tried the example code listed on the site it did.

After some testing I found the #region/#endregion only appear to work within blocks of comments that are not interrupted by any actual code. So this isn't really helpful, no.

I also found other weird things, such as the menu pictured on the website not conforming with my own although I do have both the latest version of KingsTools and the latest version of VS.Net the author adapted his tools to! E. g. the '} //End' comments option doesn't appear to work, there is no menu bar like the one imaged on the site, and the Class Dependency Graph stops with an error reading it's own created temporary file.

[edit]after some more testing #region/#endregion do appear to work, sort of: if I insert the pair of markers inside somewhere, then close the file and reopen it, the enclosed block is collapsed. Apparently whether or not the collapsable block is shown isn't always checked when it should or at least when I expected it...[/edit]

Edited by - sl@sh on Aug 11 2008 05:55:05 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Aug 19 2008 :  4:31:06 PM  Show Profile  Reply with Quote
sl@sh you might find this interesting:

http://support.wholetomato.com?W444

you will probably still need marker lines to signal the start and end of the blocks.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000