Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio (or resharper) variable and method coloring

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

like image 545
alanquillin Avatar asked Apr 23 '09 15:04

alanquillin


People also ask

What is the use of ReSharper in Visual Studio?

ReSharper helps instantly get to any code in a solution, no matter how large the solution is. It can also navigate you from any symbol to its related code such as implementations of a given interface, extension methods of a class, or usages of a field.

How do I change the color of a variable in Visual Studio?

You can edit colors in Options -> Environment -> Fonts and Colors -> Text Editor -> "Semantic *****".

Does ReSharper provide syntax highlighting?

Syntax highlightingReSharper extends the default Visual Studio's symbol highlighting. Additionally, it highlights fields, local variables, types, and other identifier with configurable colors. For example, ReSharper syntax highlighting allows you to easily distinguish between local variables and fields in your code.


1 Answers

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)

like image 78
Martin Harris Avatar answered Jan 08 '23 04:01

Martin Harris