Maxim Gueivandov
Maxim Gueivandov

Reputation: 2385

Visual Studio 2008/2010: show method names in Find In Files results

I had a dream I could see constructor/method/property names along with search results (Visual Studio Find In Files feature), if applicable/available.

For example, if I searched for _dreamProvider in Sleep.cs, I would get something like that in Find Results window:

Sleep.cs(5): protected IDreamProvider _dreamProvider;

Sleep.cs(10): Sleep(IDreamProvider): _dreamProvider = dreamProvider;

Sleep.cs(68): BeginColdSweats(int): var d = _dreamProvider.Create(DreamTypes.Nightmare);

Sleep.cs(74): BeginSomniloquy(int, string): var d = _dreamProvider.Create(DreamTypes.Epic);

This could come quite handy if you want to see at a glance in which contexts a code fragment (not only a particular symbol) is used, specifically during analysis of legacy code and/or refactoring.

I could not find any VS addin which would bring that code structure awareness in search results. And there is no specific customization registry flag for that.

Do you know of any VS addins, or some kind of hacks in order to achieve that or something similar?

Thanks

Upvotes: 7

Views: 1765

Answers (3)

Steve Dignan
Steve Dignan

Reputation: 8560

ReSharper offers this type of "Find Usages..." functionality:

http://www.jetbrains.com/resharper/documentation/help20/UsageSearch/findResultsWindow.html

Upvotes: 4

Wil
Wil

Reputation: 2368

Resharper does this

Upvotes: 2

Lieven Keersmaekers
Lieven Keersmaekers

Reputation: 58491

Have you tried CTRL+,

Searching and Navigating Code in Visual Studio 2010

Navigate To (Ctrl+comma), new for Visual Studio 2010, is a powerful way to search, especially when you’re not sure exactly what you’re looking for. It helps you locate items in your code by using "fuzzy" search capabilities. For example, if you type Foo Bar instead of FooBar, Navigate To will still return useful results. It’s a smart, incremental search that refines as you type and will find any symbols (e.g. file, type, and member names) matching your search terms.

Upvotes: 4

Related Questions