Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Highlight references under cursor highlights types

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
shippy Posted - Jan 21 2016 : 4:58:51 PM
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?
10   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Feb 05 2016 : 3:03:37 PM
Just be aware that this might take a while. Hopefully one of the other approaches will help in the mean time.
shippy Posted - Feb 05 2016 : 12:54:19 PM
Thanks! I appreciate it.
feline Posted - Feb 04 2016 : 8:11:44 PM
This makes sense, I have put in a feature request to see what our developers make of this:

case=94884
shippy Posted - Jan 29 2016 : 3:38:31 PM
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. :)
feline Posted - Jan 25 2016 : 6:37:13 PM
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
shippy Posted - Jan 25 2016 : 3:38:16 PM
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 Posted - Jan 25 2016 : 3:35:43 PM
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.
feline Posted - Jan 22 2016 : 8:08:42 PM
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
shippy Posted - Jan 22 2016 : 12:37:23 PM
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?
feline Posted - Jan 21 2016 : 11:18:42 PM
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.

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