Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find out where a variable is initialized

I have a class with variable “test” in my project. I need to find out at which page of the project/solution this “test” get initialized. Do we have any short cut keys for this, other than Ctl+F and look for entire project.

like image 686
SRA Avatar asked Jul 07 '11 12:07

SRA


3 Answers

try F12. There are some great shortcut posters here, print one out for your wall

Visual Studio 2010 Keybinding Posters

like image 75
DanDan Avatar answered Oct 16 '22 19:10

DanDan


You can right-click it, then Find All References, looking for = new, or if you prefer, Ctrl-K, R.

like image 38
George Duckett Avatar answered Oct 16 '22 20:10

George Duckett


Very similar to @George's answer, but I prefer a Ctrl+Shift+F (Find In Files). Does about the same thing as Find All References, but doesn't have to compile anything to do it.

As for specifically looking for the initialization, a find in files of text:b*= (making sure Use Regular expressions is on), would find any place where you assigned to text.

This is assuming you didn't mean Ctrl+Shift+F in your question.

like image 2
Joel Rondeau Avatar answered Oct 16 '22 20:10

Joel Rondeau