views:

1278

answers:

6

Ok, I am not sure what the naming for this is actually called, but I would like to know if the following is possible in Visual Studio.

When I set my cursor on or highlight a variable, or method name, or string... etc, I would like the IDE to highlight all uses of it. So if I highlight variable x, then it highlights all other uses of variable x.

This is done in eclipe and Notepad++, and I have become very fond of that feature, but when I move to VS, I cannot seem to get that functionality.

I know I can use the right click and find definition, also I can use resharper to find all uses, but that is not as easy and intuitive. I am currently using VS2008, but would like it in both 2008 and 2005.

Also, if this is a feature of resharper that I just don't see, that is good too.

Thanks

A: 

Sadly ReSharper does not support this...

Richard Ev
+4  A: 

This is not a feature of Visual Studio 2008 or previous versions. It will be a feature of Visual Studio 2010 though.

JaredPar
+3  A: 

With Reshaper you can press Shift+Alt+F11 when your cursor is inside a variable to highlight all usages of that variable in that file. (Then ESC to remove the highlighting)

Martin Harris
I tried that and it did nothing. I checked the keyboard bindings for Shift+Alt+F11 and it was bound to Debug.StepIntoSpecific. Did you set that buinding? what is your bound to?
aquillin
I think it's the default for the Resharper 4.0 Visual Studio scheme (at least according to the cheat sheet on my desk). Either way the command in my key bindings is "Resharper.Resharper_HighlightUsages"
Martin Harris
Wow. New one one me. Very cool, thanks!
Steve Haigh
Great thanks! My was bound to ctrl+Shift+F7. I will keep it, because I am not sure if that was changed (I am running resharper 4.5). But knowing the bindinds helped alot!!
aquillin
A: 

DevExpress Refactor or Code Rush (I have both, so I'm not sure which) will do this.

Place the cursor on a variable and hit tab; all uses of the variable that are in scope will be highlighted.

TGnat
That's a CodeRush feature.
Robert Kozak
+1  A: 
Jere.Jones
+3  A: 

With ReSharper, if you're using the IDEA keybindings, use Ctrl+Shift+F7. If you're using the VS keybindings, use Shift+Alt+F11 (like Martin Harris said).

You can find the full map of keybindings here: ReSharper Feature Map

Chris Doggett