How to list all classes implementing a interface using ReSharper? - visual-studio

Is there a way to list all classes implementing a given interface in ReSharper?
I usually find ",interfacename" to accomplish that but it is not a terrible solution.

In Resharper you can use Go to Implementation (Ctrl+F12, or click the symbol holding Ctrl+Alt keys) and use "Show in Find Results" option to show the results in the find results window.
Not resharper related, but Visual Studio 2015 after Update 1 allows you to right click the interface and select "Go To Implementation". With Visual Studio 2015 Update 2 they have added a shortcut Ctrl+F12.

Sure, put the text caret on the interface name and invoke Go to Derived Symbols - either Alt+End or Ctrl+Alt+B, depending on the keyboard scheme.
Note that you can also hit Alt+Enter on the interface name and type "derived" to get to the Go to Derived Symbols action a little quicker. Or use the Navigate To context menu to show all the navigation options for the interface name (Alt+~ or Ctrl+Alt+G)
Also, when the popup menu shows listing the interfaces, click the icon in the top right, and it will open the list in the Find Results window.

Related

What is the name of the VSIX that shows type members on mouse hover?

Used to have that extension under Visual Studio 2010 but I can't find it again.
The extension provide the following helper :
When hovering mouse over a type in the code editor a small window would pop-up and show members inside the type, saving the hassle to open the file to see what members that type contains.
You might be talking about Solution Navigator feature of Productivity Power Tools.
Solution Navigator also provides interactive tooltips in C# and VB code (replacing the default “quick info” tooltips) that give you the same kind of data, but right at your fingertips.

Visual Studio: Missing Ctrl+O+O, Ctrl+T Eclipse analog

I very like Eclipse Ctrl+O+O hotkey which includes in the list of members not only members of current class, but also all the members of all super-classes.
"Quick type hiererchy" feature also is pretty useful. Resharper has Alt + End and Alt + Home keys, but it doesn't organize result in a tree what is very handy.
Is it possible to get mentioned functionality in VS?
ReSharper provides the Type Hierarchy window (ReSharper > Inspect > Type Hierarchy) for investigating inheritance.
File Structure (ReSharper > Windows > File Structure) is ReSharper's version of Outline, and it could be what you're looking for.
Alternatively, you can step on the name of a superclass or interface being implemented in the type declaration, invoke ReSharper > Navigate > Navigate to, and choose Implementing members - it will highlight you all members from the given interface that are implemented in the current class, and you can navigate between the highlights.
If you tell me more about your usage scenario, i.e. what task you're trying to solve with an analog of Ctrl+O+O, I could advise you how to solve this task with ReSharper.
UPDATE:
ReSharper 6 (pre-release builds of which can be found here) provides a feature that corresponds to your usage scenario. In a file containing a class from an hierarchy, press Ctrl+F12 (IntelliJ IDEA keymap) to invoke "Go to File Members". Then, press Alt followed by Space to switch on the "Include members from related files" feature. This will show you any members in types up the inheritance hierarchy. You can flush results to the Find Results window by pressing +, and group them in a preferred way:

How to show all implement instance of an interface method?

In my project, there are tons of interface classes used. I have difficulties in reading to understand the code since browsing the definition of the codes (by selecting the method name and pressing F12 or right click + go to Definition) just lead me to the interface.
Is there a way (built-in or addon) in Visual Studio 2010 to list out all of the instance of a method of an interface?
Hope to hear from you.
After a while, I found that just with VS 2010, I can archive this all alone: Use "Call Hierarchy"!
Place your cursor on any member of the interface class
Right click and choose "View Call Hierarchy"
Open the "Implements..." node in the "Call Hierarchy" pane.
That's it. Enjoy ^_^!
Resharper can do this and is an excellent addition to VS.net for many other reasons that you'll discover...

Visual Studio window which shows list of methods

In Visual Studio, is there a window which shows list of methods in the active class? A small window like the Solution Explorer would be great. In Eclipse, there is one.
There's a drop down just above the code window:
It's called Navigation bar and contains three drop downs: first drop down contains project, second type and third members (methods).
You can use the shortcut Ctrl + F2 (move focus to the project drop down) and press Tab twice (move focus to the third drop down) to focus it, down arrow will expand the list.
Full size image
I found how to turn the drop down on as shown in the first answer (#ChrisF):
Go to Options->Text Editor->(your language)
and tick "Navigation bar" in the display section.
Since Visual Studio 2012, you can view the outline ( fields and methods) in the solution explorer by expanding the node corresponding to your file .
Shortcut to Navigation Bar is Ctrl+F2. Takes you to the types dropdown first. Press tab to go to method dropdown, and then enter on a method to go to that one.
ReSharper has a 'ReSharper | Windows | File Structure' window, which is used for visualizing current code file structure.
Resharper has the File Structure window which is very similar to eclipse outline view. Originally answered in:
Visual Studio 2012: List of all Methods in class
Resharper help:
http://www.jetbrains.com/resharper/webhelp/Reference__Windows__File_Structure_Window.html
Despite it's an old question maybe this answer help you as helped me.
you can download codemaid extension from here : codemaid website
it has a lot of functionality that you may find in their website.
the one that is related to this question is code digging
Visualize and navigate through the contents of your C# and C++ files from a tree view hierarchy. Quickly switch between different sorting methods to get a better overview. Drag and drop to reorganize the code. See McCabe complexity scores and informative tool tips.
in other words it give you ability to see the methods and properties and also reorganize them just with drag and drop. it's my everyday use extension
There is no direct equivalent to the Outline View in Eclipse. The closest thing I've found is the Class View, which lists all classes and their members/methods. There is a search box at the top to narrow the selection.
In Visual Studio 2019, there is the "Go To Member" action located in Edit - Go To that is mapped by default to ALT+\. I think this was added in Visual Studio 2017.
This is what pops up which provides the desired functionality and a couple of options:
In Visual Studio 2015, View > Other Windows > Resource View. The keyboard shortcut is Ctrl+Shift+E. I find this cleaner than Class View. With Class View Windows you can filter methods/attributes based on access modifier (private/protected/public) etc.
A nice clean way to do this is to use the command View.SynchronizeClassView by entering it into the Command Window (View > Other Windows > Command Window or Ctrl+Alt+A) but there's no way to do it automatically.
Additionally, you can:
pin your Class view window
collapse the top pane (listing all the classes)
And now it feels just like the Visual Assist's feature "List Methods in Current File" (which also list members btw).
At the top of your text editor, you should have a dropdown that lists all the methods, properties etc in the current type; and it's clickable (even if those members are defined in other files - in which case they're greyed out but you can still navigate with them).
Also, if you use the Class Explorer (Ctrl+Alt+C) to navigate your project, then you'll get a full overview of all your types. However, there doesn't appear to be a setting in Tools/Options that allows you to track the active type in that window (there is for the solution explorer) - perhaps a macro or addin is in order...
Microsoft doesn't feel like implementing this useful tool, but if by chance you can have Visual Assist, you have it in VAssistX > Tools > VA Outline. The plugin is not free though.
In Visual Studio 2005 and 2008 you can try the Source Code Outliner Power Toy.
alt text http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=SourceCodeOutliner&DownloadId=3493
Do you mean the class view window (View->Class View, or Ctrl+W,C)?
You also have the intellisence popup-window
With Visual Studio 2010
You choose Tools->Settings->Expert Settings
On the left-bottom corner, you will see the tab "Class View" right next tab "Solution Explorer"
In the top area of "Class View" layout, you will see the list of class name, enum, struct, ...
In the bottom area of "Class View layout, you will see the list of member for these class, enum or struct
I have been using USysWare DPack since forever. It is very small and not intrusive so if all you want is a quick shortcut window showing list of methods of the current file you are using, it provides just that. Good thing is that the author is still active after more than 10 years just to keep providing the same features into latest VS release.
https://marketplace.visualstudio.com/items?itemName=SergeyM.DPack-16348
After installation, just use Alt + M to bring up the method list window. I prefer to show all members instead, but it's up to you.
In VS 2012, just go to View > Class View...then you get the Class View GUI in the main tab area. Now, drag this over to the side dock and you have the exact same layout as you would in Eclipse.
-e
My best way to do this is, that i open the Code Definition Window, under View -> Code Definition Window or press Ctrl + W,D .
And then i got it floated and i have the definitions of methods in separate windows.
Regards
grep -i " sub " filename.vb > methods.txt
grep -i " function " filename.vb >> methods.txt

Is there a hotkey in Visual Studio to open the member drop down list?

In Visual Studio there is a drop down list in the top right hand corner that you can use to navigate to the various members in the class. Does anyone know if there is a hot key to open this ddl?
I think you're looking for Ctrl + F2, which moves the cursor to the navigation bar at the top of a code view. From there, you can press Tab to move the cursor over to the member list.
For this (and pretty much every other Visual Studio hotkey/shortcut key combination), see here.
Visual Studio 2017+: They now support Resharper-like shortcuts. They work pretty well, too.
Ctrl+T - 'Go to All' (class/member/file), type m MyProp for members only
Alt+\ - 'Go to Member in current file'
Using VS 2008, I still don't know how to get directly to the Members dropdown which is what I want. But, the key bindings will be different for everyone. The command you want to search for under Options > Keyboard > Show commands containing: is Window.MoveToNavigationBar.
Assuming you are using the default keybindings packaged with Visual Studio, CTRL+F2 will focus the top-right drop-down list, and you can then navigate members by pressing TAB and using the arrow keys.
In my install of VS 2013, this is called Window.MoveToNaviationBar and is bound to Ctrl+F8. This is visual C++ settings.
Use Ctrl + F2 to get up there, then a click on Tab will get you to the member list instead of the object list.

Resources