Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Quick "highlight references" for local variables

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
accord Posted - Jun 27 2008 : 5:18:10 PM
I created this macro to highlight all references of a local variable:

Sub HighlightByContext()
    DTE.ExecuteCommand("VAssistX.FindReferencesinFile")
    DTE.ExecuteCommand("Window.ActivateDocumentWindow")
    DTE.ExecuteCommand("VisualAssistX.RefResultsToggleHighlight")
End Sub


I have assigned it to a keyboard shortcut, so I can access very easily on demand. If you run first time after visual studio start it will take seconds, but after that it will work like a charm. The last line is only needed if you haven't checked "Highlight References" in the Refactoring section of Visual Assist X Options Dialog.

The macro set the focus to the editor instead of find references results, so it will not break your workflow.
6   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jul 20 2009 : 4:21:11 PM
This is an IDE macro, not normal source code. In VS2005 have a look at the menu items:

IDE Tools menu -> Macros -> Macro Explorer
IDE Tools menu -> Macros -> Macros IDE...
tieuvodanh Posted - Jul 20 2009 : 1:45:39 PM
Hi,

How to use this macro? After putting it with a shortcut key and place this code in my code then Build will generate error when build my code.
something like: error C2146: syntax error : missing ';' before identifier 'HighlightByContext'
...
Could you help me know what we could with this macro?

Thank for your help !
accord Posted - Oct 05 2008 : 08:00:32 AM
sl@sh: in VS2008/2005 (with VAX 1649) the focus will be on find references list. So it is maybe VS2003 specific or you may use old VAX?
GennadiyKorol Posted - Sep 23 2008 : 4:16:54 PM
Good stuff, thanks!
sl@sh Posted - Aug 25 2008 : 05:01:26 AM
Hmm, in VS 2003 the second command (Window.ActivateDocumentWindow) leads to an error. Is there any other way to invoke this action? I've tried and inserted spaces ("Window.Activate Document Window") because that is how the command is listed when I look at the customize dialog, but in that case the interpreter stops at the first space.

Any other suggestion? (apart from upgrading to a newer IDE....)

P.S.: I just realized that after the first line the document window still *is* the active window, so I actually don't need the second line. Or what else was it meant for?
feline Posted - Jul 11 2008 : 1:50:45 PM
I like this

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