Reference Highlighting in Visual Studio 2010

There is a nice feature in Visual Studio 2010. It’s called Highlighting Reference.

How this feature works is when you are working on your code in the editor and click on a symbol (class, object, methods, properties, variables), then all instances of the symbol are automatically highlighted. This makes it very easy to locate where a symbol has been used in that document.

You can use CTRL+SHIFT+DOWN ARROW (move down) or CTRL+SHIFT+UP ARROW (move up), to navigate through the highlighted instances of that symbol.

Here’s an example that highlights all instances of View() on the page when i click on any one of the references.

image

If for some reason, you do not see the highlighting, make sure that the feature is turned on by going to Tools > Options > Text Editor > C# > Advanced

image

Change Highlighting Reference Color

If you are not happy with the color used for highlighting, then you have an option to change it. To do so, go to Tools > Options > Environment > Font and Colors > Make sure ‘Text Editor’ is the chosen option in the ‘Show settings for’ section > Choose ‘Highlighted Reference’ in the Display Items List Box and use the Custom button to change the foreground and background color.

image






About The Author

Suprotim Agarwal
Suprotim Agarwal, Developer Technologies MVP (Microsoft Most Valuable Professional) is the founder and contributor for DevCurry, DotNetCurry and SQLServerCurry. He is the Chief Editor of a Developer Magazine called DNC Magazine. He has also authored two Books - 51 Recipes using jQuery with ASP.NET Controls. and The Absolutely Awesome jQuery CookBook.

Follow him on twitter @suprotimagarwal.

2 comments:

Anonymous said...

Nice, but how do I disable the annoying 2 seconds delay between a click on a symbol and the appearance of the highlighting?

Anonymous said...

That delay is driving me nuts...