Reputation: 38704
If I'm looking at a method definition in Visual Studio (with Resharper) is there an easy way to find out what class it belongs to? (As of now, I've resorted to a text search in the "up" direction for the string "class".)
Upvotes: 0
Views: 197
Reputation: 10138
Aside from using ReSharper's File Structure and/or Go to Containing Declaration - options mentioned previously - there's also a tiny feature in ReSharper called Quick Documentation that in my view is better suited for this kind of task since it shows you method info in-place, without forcing you to navigate anywhere from the method you're on. Ctrl+Q, Esc, and you're done. It works on all kinds of symbols (not limited to methods), both on declarations and on usages.
Upvotes: 1
Reputation: 4371
The best (direct) way specific to your question is PHeiberg's answer.
But if you ask this question I guess you don't know the File Structure window that can be enabled by ReSharper->Windows->File Structure or by shortcut Ctrl+Alt+F.
With that window you see always where you are in your file.
Upvotes: 1
Reputation: 63340
You have files with more than one class in? That makes ponies sad...
Anyway, to actually answer, can't you just look at the navigation bar?
Upvotes: 1
Reputation: 29811
The Resharper command Go to containing declaration (ctrl + [) should do the trick
Edit: Or if you have the navigation bar at the top of the code window enabled, that should display the type name. But I have that turned off, since I use keyboard navigation and the bar itself slows down Visual Studio.
Upvotes: 4
Reputation: 31
For VS, right click on the function and select 'Go To Declaration'. (Ctrl + F12)
Upvotes: 0