views:

586

answers:

3

The Eclipse IDE has a neat little feature that I really miss in Visual Studio.

If I place the cursor on a variable or method name, the IDE will automatically highlight all references to it in the current document within the relevant scope.

I can't seem to find an option to turn on similar behaviour in VS2008 or Resharper 4. I know VS has a Find Usages function, but I'd like to do it automatically on the fly.

Does anyone know of a free addin which will add this functionality?

+2  A: 

If you're using ReSharper, you can highlight the usages in the file with Shift-Alt-F11. Place your cursor on the variable you want to find usages of, and press the Shift-Alt-F11 combination.

Bernhard Hofmann
+1  A: 

There is an add-in for Visual Studio that will do something similar called RockScroll. When you double click on something, it will highlight all occurrences of the item you double clicked. It also changes the vertical scrollbar to a "syntax highlighted thumbnail view" showing an overview of where the item occurs in the file.

Slapout
Note that RockScroll doesn't highlight by entity, but by string. But it is an excellent plugin.
Benjol
+1  A: 

I know you mentioned ReSharper, but CodeRush has a nice references window that you can dock and let it search for things on-the-fly or on demand. As a bonus, you can select each usage and it will show you the context surrounding the usage. It also works for methods.

I mentioned CodeRush since they have an express edition, which looks like it includes that feature, but I haven't tried that edition.

Matt David