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
 Highlight references under cursor highlights types
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

shippy
Senior Member

USA
28 Posts

Posted - Jan 21 2016 :  4:58:51 PM  Show Profile  Reply with Quote
Hello. I'm using VA's reference highlighting features in VS 2015. What I'm noticing is if I highlight a type in my code (like HRESULT or shared_ptr) then it highlights all uses of that type in the file, which is distracting for me. The option I have set in VA is to highlight read and write references under the cursor and a type is neither of those. Is there an option to turn off the reference highlighting for types?

-Shippy

feline
Whole Tomato Software

United Kingdom
18750 Posts

Posted - Jan 21 2016 :  11:18:42 PM  Show Profile  Reply with Quote
Unfortunately no, the setting is either On or Off. When you consider classes, and other user defined types, it makes more sense to highlight types. Pressing Escape clears the highlighting, but it appears again as you move the caret into a new symbol.

Instead of using this, you could try turning this option off, and turning on:

VA Options -> Highlighting -> Highlight results of Quick Find and Find in Files

you can then map a keyboard shortcut to the command VAssistX.FindSelected, personally I have it mapped to Alt+K. Then, when you are interested in seeing all references to a given symbol, just press Alt+K with the caret in the symbol, no need to bother with the Find dialog.

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

shippy
Senior Member

USA
28 Posts

Posted - Jan 22 2016 :  12:37:23 PM  Show Profile  Reply with Quote
Thanks for the tip. Unfortunately, that shortcut means I lose the ability to see the difference between read/write references. Additionally, I get things like choosing something named 'foo' will highlight the 'foo' part of things with that part of the name in it, like 'fooblah'. The name of the option is for read and write references, not types. Would it be possible to make this a feature request?

-Shippy
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18750 Posts

Posted - Jan 22 2016 :  8:08:42 PM  Show Profile  Reply with Quote
You do have a point, my concern with excluding "types" is where to draw the line. Built in types like "int" and "float" are clear cut, but you are listing HRESULT and shared_ptr. If we exclude classes, which would exclude shared_ptr, you would loose this on all classes, which seems a bit drastic. Or would disabling this on all types actually work for you?

Have you considered turning off automatic highlighting, and then using Find References in File? This will still highlight, and only the correct symbol, and you get the colours. By limiting this to Find References in File, as opposed to a full Find References, the scan will be a lot faster, and you get stable highlighting, it won't change until you do another find.

If this helps you can trigger both Find References and Find References in File via the refactoring context menu, Alt-Shift-Q, or a middle mouse click if you have this turned on. Or you can map a keyboard shortcut to VAssistX.FindReferencesinFile

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

shippy
Senior Member

USA
28 Posts

Posted - Jan 25 2016 :  3:35:43 PM  Show Profile  Reply with Quote
I tried the Find References in File, but the context switch to another window makes it a non-starter for me, unfortunately. I still think that highlighting types when the option refers to read and write references only feels incorrect. I'd love it if there were another checkbox for highlighting type references and then I could just disable that and keep the read/write option. Thanks for your consideration and tips.

-Shippy
Go to Top of Page

shippy
Senior Member

USA
28 Posts

Posted - Jan 25 2016 :  3:38:16 PM  Show Profile  Reply with Quote
I also notice that the reference highlight also highlights control statements. So, I put my cursor over an 'if' and all 'if' statements get highlighted. I'm not really sure why that's happening, either. It feels like it would be of limited use and can make the editor window quite busy looking. Just my opinion, though. :)

-Shippy
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18750 Posts

Posted - Jan 25 2016 :  6:37:13 PM  Show Profile  Reply with Quote
I see what you are saying, but consider that in C++ macros get used for all sorts of things. We don't have a simple list of 6 keywords to avoid highlighting.

If we don't highlight a class name, then what about the class constructor? Do you want this highlighted?

In the VA options dialog, for coloring, we have 4 basic catagories of symbols:

* Classes, structs, interfaces, namespaces, typedefs
* Variables
* Enums, preprocessor macros
* Functions / methods

and we can probably safely add the group:

* keywords

which groups would you want to exclude from being highlighted? Keywords obviously. All of "Classes, structs, interfaces, namespaces, typedefs"? This should take care of types, but is it going to exclude things that you want highlighted?

"Enums, preprocessor macros" is covered by HRESULT, but wouldn't you want enum items to be highlighted? I am trying to keep this simple

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

shippy
Senior Member

USA
28 Posts

Posted - Jan 29 2016 :  3:38:31 PM  Show Profile  Reply with Quote
For me, I think it's only variables that I really care about being highlighted in-line under the cursor since those are the only things that can really be read from or written to, right? Personally for everything else (e.g. seeing where a particular enum value is used), I would use the FindReferences or FindReferencesInFile capability to get an overall view. I hope I've articulated myself well enough as I also want to keep it simple. :)

-Shippy
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18750 Posts

Posted - Feb 04 2016 :  8:11:44 PM  Show Profile  Reply with Quote
This makes sense, I have put in a feature request to see what our developers make of this:

case=94884

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

shippy
Senior Member

USA
28 Posts

Posted - Feb 05 2016 :  12:54:19 PM  Show Profile  Reply with Quote
Thanks! I appreciate it.

-Shippy
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18750 Posts

Posted - Feb 05 2016 :  3:03:37 PM  Show Profile  Reply with Quote
Just be aware that this might take a while. Hopefully one of the other approaches will help in the mean time.

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