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开发者_Python百科): 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
ReSharper offers this type of "Find Usages..." functionality:
http://www.jetbrains.com/resharper/documentation/help20/UsageSearch/findResultsWindow.html
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.
Resharper does this
精彩评论