Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Collapse all except <name>

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
hajokirchhoff Posted - Oct 27 2011 : 08:57:00 AM
VisualAssist has a very good parser and query interface. I love Ctrl+M, where it shows me a list of methods defined in a file and I can just start typing and it narrows down that list.

Here is my suggestion: Show only <name>, implemented as a "collapse all except <name>" will collapse all definitions in a file except those that match the <name>, where <name> is the usual VisualAssist filter syntax.

I'd bring up a "show all ..." dialog, start to type the name as I do with Ctrl+M and hit <enter>. This would collapse all methods except the ones I want.

Actually hiding unwanted code or showing only methods that match the filter would be even nicer, but I guess much harder to do. So I would settle for above "collapse all except".

Regards

Hajo
12   L A T E S T    R E P L I E S    (Newest First)
hajokirchhoff Posted - Nov 23 2011 : 02:52:52 AM
quote:
Originally posted by feline

Alt-M list,
[...]
So you would use a different keyboard shortcut, or menu command, to open the same list:


Ah, I missed this (different keyboard shortcut). I like that idea. It does not have to be in VAOutline. I only thought it would be nice to filter the outline as well sometimes. But a separate Alt-M like keyboard command would give me exactly what I want right now.

Hajo
feline Posted - Nov 22 2011 : 4:56:08 PM
Find References is designed to find references in many files. You can run Find References in File, but this is not really designed to give you a list of functions, it is focussed on references instead. The Alt-M list is designed to let you focus on and find a specific function.

You can simply tell the IDE to collapse the entire file to definitions with a single command, then allowing you to unfold just the functions you want to look at and work on.

If we got a basic form of this command working, I could see it slowly being expanded, but for now, I would like to keep the feature request fairly focussed and specific. Otherwise we risk having lots of different ways of triggering this, which would be overkill for now.
gmit Posted - Nov 22 2011 : 04:45:17 AM
feline, actually, I kind of like what you've described and I could live with it. Although, I often work with large files with many functions, so, to browse such code, it would be much more convenient to automatically unfold all functions matched within a file.
feline Posted - Nov 21 2011 : 7:34:57 PM
gmit how do you see this working?

Using the Alt-M list is an "odd" approach, but it is fairly quick and simple, and it clearly focus's on functions, which are the items you are hiding and showing.

You can already use Find References, run the IDE command:

IDE Edit menu -> Outlining -> Collapse to Definitions

and then jump to the references you want, and the function you jump into will be expanded. I have just tested this in VS2008.
feline Posted - Nov 21 2011 : 7:28:32 PM
I have been thinking about how to trigger "collapse all except..." myself, and I am wondering about a command that opens the Alt-M list, and uses it normally, but then does the collapse. So you would use a different keyboard shortcut, or menu command, to open the same list:

case=62856


Why do you want to filter VA Outline? The point of VA Outline is to give you an overview of your entire file, and if you are hiding most of the functions in the editor, it won't be to cluttered when you move from function to function here.

The Alt-M list does show regions, which is why we added a registry key to hide them for the people where they were getting in the way:

http://docs.wholetomato.com?W347
gmit Posted - Nov 21 2011 : 4:25:25 PM
Hello.

I'm also pretty interested in this feature, although, it's a bit hard to predict how such idea would actually behave in reality.

Personally, I would be interested in having an option to temporarily filter out all everything except for functions that contain some symbol. For example, this might be invoked from find references window...
hajokirchhoff Posted - Nov 20 2011 : 03:32:19 AM
quote:
Originally posted by feline

You have made a good case for this feature, I am happy to put in a feature request


Great :-)
The Alt-M list would do fine to select the functions. I wonder how I would activate the "collapse all except..." mechanism from this list. I mean, Alt-M is a temporary list. Would you add a button at the bottom of the list? Better at the top.

The VAOutline would benefit from a filter, regardless of whether it had a collapse except method or not. And if it has a filter, it could have a drop down combobox and have a history of filters. Combined with the collapse all except feature this could be a really powerful and very fast way of switching between views.

Another pro for the VAOutline: VAOutline shows regions, whereas Alt-M does not. The filter could include regions. A simple collapse all except algorithm would first collapse all structures in a file and then expand all structures that match the filter. Thus it would expand methods, but could also expand regions. A much faster way to expand several regions at once than scrolling through the file and clicking on the + sign.

Anyway, many thanks for VisualAssist. It's a real helper :-)

Hajo
feline Posted - Nov 18 2011 : 1:23:10 PM
You have made a good case for this feature, I am happy to put in a feature request, I am just wondering about the right way to specify the functions to keep expanded. Using VA Outline might make sense, but you are likely to have some problems finding the 2 or 3 functions you want to select if you have a long and complex file.

The Alt-M list certainly makes sense, I am just wondering how well suited it is to what you want. From the examples you have posted so far it sounds like it will do what you want quite well.
hajokirchhoff Posted - Nov 18 2011 : 04:55:32 AM
I am aware of the functions that Visual Studio offers me. The problem is, I have many different "views" of one and the same file, but I cannot switch between these "views" very easily.

I can collapse or expand sections, but in reality the sections I am interested in change rapidly. One minute I want to see only functions related to "Paint". The next minute I need to see everything related to "Save".

Collapsing/hiding unrelated code is very helpful. It eliminates a lot of "noise" and helps me focus on the immediate task.

I have the same problem with the VAssist Overview, btw. It's a great tool, but at the same time it shows too much information.

"Okay, I'm in OnPaint. Now where was that PreparePaint method again?"

If I "goto" to PreparePoint, I loose the context of OnPaint, because it is two pages below and there is PrepareSave and OldClunkyHack inbetween. Sure, I can add a region around these, but tomorrow, when I need to work on Save, I have to manually expand this region and manually collaps all regions concerning "Save". Way to many mouse clicks, especially when my mind-context changes every 10 minutes.

That is where a collapse all except... would come in very handy. "Collapse all except Paint" and, voila, only OnPaint and PreparePaint are visible. Everything else is hidden away. "Collapse all except Save" and, presto, I see only "Save".

Sure there is a danger of dangling regions. But a small one and if the regions all contain names/comments starting with vax_hidden_ or the like, a new "Collapse all except..." command could simply remove all #region/#endregion lines that have this marker.

I think, if done properly and accessible via a short cut it would be a great help. Perhaps you could integrate it in VA Overview. Have a search field there, show only entries in VA Overview that match the search and have a button: "Collapse all hidden..."
feline Posted - Nov 17 2011 : 5:18:51 PM
You make a good case for this. In VS2008 you can select a block of code, several functions long, and simply tell the IDE to hide this selection, without having to edit the file or add any markers. So this would be a better way forward, it avoids the risk of leaving unwanted temporary region lines in the code file.

Is using the Alt-M list filtering going to give you the sort of control you need? This is really designed to help you find and jump to a single specific function, not to select a group of functions in the file. Then again, it is a fast way of selecting a group of functions.
hajokirchhoff Posted - Nov 17 2011 : 04:34:40 AM
quote:
Originally posted by feline
IDE Edit menu -> Outlining -> Collapse to Definitions
Alt-m to show VA's list of methods in file...


Not really what I want, because I'll only see this one method then. I want to see (expand) all methods that match the search criteria.

Even better would be a feature that would add a #pragma region statement around all areas that don't contain methods that match a specific pattern.

Example: My .cpp file contains methods for two classes. I want to hide everything except methods of class 'foo'. Choose VisualAssist|special|show only..., enter foo.* VisualAssist creates a couple of #pragma regions Hidden and collapses all these regions.

I choose "show only" again and this time I enter 'bar.On'. VisualAssist removes all regions named "Hidden" and creates new regions around everything that does not match bar.On.

In effect I will see only bar::OnMouseMove, bar::OnLeftClick and so on. Everything else is hidden inside a few regions.

Would help greatly, especially with old (spaghetti) code. These files tend to be huge and cluttered. The ability to "hide everything except..." would be a great benefit.
feline Posted - Oct 27 2011 : 5:19:03 PM
Which IDE and programming language are you using?

Using VS2008 and C++ I have just tried:

IDE Edit menu -> Outlining -> Collapse to Definitions

Alt-m to show VA's list of methods in file, select a method, and the method was jumped to and expanded. This seems to be close to what you are wanting.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000