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
 Technical Support
 1810: Find Symbol/References woes
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Alexo
Ketchup Master

Canada
81 Posts

Posted - Feb 09 2010 :  12:24:17 PM  Show Profile  Reply with Quote
Preparation:
Open a solution.
Open a text file, not part of the solution.
Fill the text file with names of symbols from the solution.

Trying to accomplish:
Going over the collected symbol names, find their uses in the solution.

Doesn't work at all:
In the text file, put the cursor on the symbol and click on "Find References".

Works incorrectly:
Copy the symbol name to the clipboard.
While the text file has focus, click on "Find Symbol".
Paste the symbol into the dialog.
Right click the found symbol and select "Find References"

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Feb 09 2010 :  1:37:05 PM  Show Profile  Reply with Quote
Find references is a highly context-dependent command. It means that you'll need the context from the source file to qualify the symbol (i.e. in which namespace or class the symbol was defined in). Without these informations, you can use Find in Files.

If you want to run find references on several symbols you can do the following:

1. create a new cpp file instead of a txt file
2. create a big function, for example:

void FindRefs()
{
}

3. Put the symbols into this function with qualifiers, for example:

Class1::Symbol1;
Class1::Symbol2;
Class1::Symbol3;
Class2::Symbol1;
Class2::Symbol2;

etc.

About find symbol: it should work. What problems do you see with this when you Right click the found symbol and select "Find References"?
Go to Top of Page

Alexo
Ketchup Master

Canada
81 Posts

Posted - Feb 09 2010 :  2:04:10 PM  Show Profile  Reply with Quote
1. Find references works if I just paste a symbol into the dialog, there is context information from the source.
Why can't it do the same when I select a symbol from the text file? Just simulate a copy/paste.

2. I click on the "Find Symbol" icon and type (or paste) the symbol name
I can select an entry from the list and go to it, no problem.
I can also select an entry from the list and do a "Find References" on it, but not if the active file is a text file -- I get an empty result set in that case.
Now, if I create an empty .cpp file (not a part of the solution), make its window active and do the same, it will work, even though there is no "context from the source".
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Feb 10 2010 :  2:40:30 PM  Show Profile  Reply with Quote
The issue here is that the type of the active file affects the context of Find References.
case=39527
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Feb 11 2010 :  7:44:03 PM  Show Profile  Reply with Quote
Visual Assist features and context resolving normally works only in source files. Simulating copy-paste: I think it is doable via an IDE macro. You can even assign a shortcut key for it. General discussions about IDE macros that may help:

http://www.wholetomato.com/forum/forum.asp?FORUM_ID=35
Go to Top of Page

Alexo
Ketchup Master

Canada
81 Posts

Posted - Feb 11 2010 :  7:46:12 PM  Show Profile  Reply with Quote
Sorry accord, I don't understand.
Are you referring to my 1st point or to the 2nd?
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Feb 12 2010 :  5:12:36 PM  Show Profile  Reply with Quote
I'm referring to the first point: I meant you can write a macro that copies the selected text then opens Find Symbol dialog and pastes the content of the clipboard. Hope I was clearer this time
Go to Top of Page

Alexo
Ketchup Master

Canada
81 Posts

Posted - Feb 12 2010 :  5:29:15 PM  Show Profile  Reply with Quote
OK. I guess I could do that as a workaround but why can't VA do this when it does not recognize the file type?
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Feb 13 2010 :  2:06:31 PM  Show Profile  Reply with Quote
To be honest it seems a little unusual to use the form Class::Symbol in a text file and then using find references on it.
Macro is a way to implement custom needs, isn't it?

Visual Assist is designed to assist when you work with a source code rather that some txt file. Re-implementing some features in a limited form to work with text files is possible, but this is not our primary focus.
Go to Top of Page

Alexo
Ketchup Master

Canada
81 Posts

Posted - Feb 13 2010 :  11:24:44 PM  Show Profile  Reply with Quote
Consider the situation when you have a large pile of source, written by somebody else, and you have to add/change functionality.
So you begin sifting through the code, making notes of "interesting" symbols which you want to revisit later.

At least, that was the case when I found out this limitation.
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