views:

22

answers:

1

It comes up from time to time and I'm wondering of it's possible to use type info when searching in visual studio, or is there a plugin that includes this?

I'd like to search for the phrase

"x == "

or

"x.ToString();" 

where x is of type 'Person'. The normal regex searches are strictly searching the text as opposed to the content and I figured out a long time ago that any thought I have is never the first.

A: 

The simple answer is no. If you wanted to do this kind of advanced searching you'd need to use Reflection to examine the type of the variable.

The Visual Studio automation object, EnvDTE, has some interfaces such as SolutionItem that can be used to examine code. You might look into that.

Dave Swersky