March 31, 2010

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



'Like' us on our FaceBook page if you find this blog useful. Thanks!


Did you like this post?
kick it on DotNetKicks.com Save on Delicious
subscribe via rss subscribe via e-mail
print this post follow me on twitter


About The Author

Suprotim Agarwal, ASP.NET Architecture MVP works as an Architect Consultant and provides consultancy on how to design and develop Web applications.

Suprotim is also the founder and primary contributor to DevCurry, DotNetCurry and SQLServerCurry. He has also written an EBook 51 Recipes using jQuery with ASP.NET Controls.

Follow him on twitter @suprotimagarwal

comments

2 Responses to "Reference Highlighting in Visual Studio 2010"
  1. Anonymous said...
    December 21, 2010 5:46 AM

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

  2. Anonymous said...
    April 20, 2011 1:43 PM

    That delay is driving me nuts...

 

Copyright © 2009-2012 All Rights Reserved for DevCurry.com by Suprotim Agarwal | Terms and Conditions