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
 Keyboard shortcut to toggle symbol highlighting
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

BozicaAyda
New Member

3 Posts

Posted - Nov 06 2023 :  7:05:17 PM  Show Profile  Reply with Quote
I see that there is already a keyboard shortcut named `VAssistX.RefResultsToggleHighlight`, which I get a lot of use out of! However, I find the highlighting of the symbol under the cursor (https://docs.wholetomato.com/default.asp?W186) to be kind of distracting when I'm not specifically looking for other references to the symbol under my cursor. My current solution is to disable the feature, and to do a Find All References on the symbol I'm interested in, wait for the operation to complete, then use the existing keyboard shortcut to toggle highlighting of that symbol that I deliberately searched for. It would be much more convenient for me if there were a similar keyboard shortcut that could enable and disable the highlighting of the symbol under the cursor. Let me know if any of the above is unclear, thanks!

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Nov 07 2023 :  07:54:54 AM  Show Profile  Reply with Quote
What I do to achieve a very similar, if not identical result, is I have mapped the keyboard shortcut Alt-K to the command:

VAssistX.FindSelected

now when I place the caret into a symbol and press Alt-K all instances are highlighted by VA as if I had done an IDE Find, but without having to actually trigger a Find, or wait for the Find to run.

Then I press Escape to clear this highlighting when I am finished with that symbol.

The highlighting does get updated / moved when you do an IDE find, but I don't tend to find that to be a problem. If anything, the hardest thing is finding a nice keyboard shortcut that isn't already in use.

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

BozicaAyda
New Member

3 Posts

Posted - Nov 10 2023 :  5:01:44 PM  Show Profile  Reply with Quote
I see. When I trigger the VAssistX.FindSelected command, I see substrings of other symbols being highlighted as well. For example: if I press Alt+K when my cursor is on a symbol named "Source", the word "Source" is highlighted on each line of this enum, even though the symbol that my cursor is on clearly doesn't appear in this code block:


enum ImGuiInputSource
{
    ImGuiInputSource_None = 0,
    ImGuiInputSource_Mouse,
    ImGuiInputSource_Keyboard,
    ImGuiInputSource_Gamepad,
    ImGuiInputSource_Clipboard,     // Currently only used by InputText()
    ImGuiInputSource_Nav,           // Stored in g.ActiveIdSource only
    ImGuiInputSource_COUNT
};


Are you seeing this behavior as well?

Also, ESC doesn't appear to clear the editor of any highlighted text. Every occurrence of "Source" remains highlighted. What command do you have bound to ESC in Visual Studio?

Edited by - BozicaAyda on Nov 10 2023 5:03:09 PM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Nov 13 2023 :  10:04:30 AM  Show Profile  Reply with Quote
I am seeing the same behaviour for highlighting part of a symbol, I had not noticed that before.

For highlighting, have you tried Find References in File? Since it is only checking the current file it should be very fast. You can map a keyboard shortcut to this command by mapping:

VAssistX.FindReferencesinFile

since this is a code aware find and highlight, it will only highlight full matches. Again, Escape removes the Find Refences highlighting from the editor for me.

As for what Escape is mapped to, the VS2022 settings dialog reports that it is mapped to:

Edit.SelectionCancel

4 times, with 4 different scopes, but one of the scopes is "Text Editor".

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

BozicaAyda
New Member

3 Posts

Posted - Nov 27 2023 :  3:10:43 PM  Show Profile  Reply with Quote
That might be a nicer solution. I find that whenever I trigger "VAssistX.FindReferencesinFile", the "highlight all" checkbox in the top right of the "VA Find References Results" window is always unchecked, even if the box was checked in the previous "instance" of that window, which was replaced by the new Find References Results that was created by triggering the "VAssistX.FindReferencesinFile" command. Is there a setting that will prevent me from having to manually check that box every time I create a new references results window?
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Nov 28 2023 :  07:53:23 AM  Show Profile  Reply with Quote
If you simply go into VA options dialog and turn On:

VA Options -> Highlighting -> Highlight write references using

and set the two colours you want, then Find References Results will be highlighted by default every time you run Find References. This should help.

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