views:

187

answers:

3

When i rightclick something in visual studio and press Find all references i get a list of all locations where this object occur.

Is there any way to also show the scope of this location (Namespace.Class.Method) instead of just a line-number. Now i have to doubleclick all of the results to see where it actually is.

A: 

Sorry, for this you'll need a productivity tool, like Reshaper. (Other productivity tools, such as DevExpress, do exist, however I don't know if they also provide such a feature.)

Jaimal Chohan
A: 

Using the default feature in Visual Studio, you can't achieve that. The Find All References seems to use the same search engine as the Find In File.

As M.Chohan said, a plugin like Reshaper or DevExpress CodeRush might have the feature you are seeking.

Pierre-Alain Vigeant
It does search in the correct scope so i think it's a bit more advanced than Find in file, for example you can Find all references of "i" in a for-loop and not find all loops in the entire file. But i'm also afraid it's not possible to exploit this advancyness without plugins.
@Pierre: Find All References is *completely* different from Find in Files. The algorithms are fully disjoint.
280Z28
+1  A: 

One more vote for ReSharper. Check here for some screenshots as to the type of results. You can change how the results are presented (My favourite is Project+Namespace+Member, so I can see which methods the references are coming from.)

You also have a few options to refine your searches. For example:

  • Search project / file or even include referenced libraries
  • Search for Read or Write usages
  • Search for "text" matches

They have a free trial available... try it out.

Nader Shirazie