On a right mouse click on a method call, we get a context menu with options "Go to definition" and "Go to implementation" options among others.
Why is the "Go to implementation" option sometimes missing?
For visual studio 2015, there is this extension: Go To Implementation
It's an extension that allows to go to the implementation of the selected class, method or property (useful when using interfaces). Similar to the ReSharper feature.
It also supports multiple implementations when found
Of course already exists in Visual Studio ! It is there since ever.
Right click on your code (Ex: property) an select "View Call Hierarchy". In Call Hierarchy window select the Implements folder.
There you are. Why Resharper ???
Of course is not that complex as go to implementation from resharper which allows direct interrogation on interface, but only a property, or a method from that interface should be enough. Ex:
public interface IModule
{
int Count { get; set; }
}
public class Module : Imodule
{
public int Count {get; set;}
}
public class Module2 : Imodule
{
public int Count {get; set;}
}
Right click on the property (anywhere - inside the class or inside the interface) and select "View Call Hierarchy", should say which class implements them, and therefore the whole Interface.
At the beginning we all love Resharper, with time, we all hate it !
This ReSharper context menu item "Go To Implementation" only shows up if there is an implementation for the base member.
It is not shows up in every place because ReSharper does not find itself on the base member that has been implemented.
http://www.jetbrains.com/resharper/features/navigation_search.html#Go_to_Implementation
I think that happens sometimes when you load a file individually that isn't part of a project. When you make a VC++ project, Visual studio generates an intellisense database. *.ncb in older versions, and *.sdf in 2010
Related
The one Resharper feature that I want is the ability to right click on an interface method or property, and go to the actual implementation, not the interface. So if I have this interface and class setup:
public interface IExample
{
void MyMethod();
}
public class ExampleInAction : IExample
{
public void MyMethod()
{
// stuff
}
}
And somewhere else in my code I'm calling MyMethod on an IExample:
IExample thing = GetExample();
thing.MyMethod();
I want to be able to right click on the MyMethod on thing, and be taken to the definition ExampleInAction.MyMethod. Visual Studio out of the box has a Go To Definition, which would take me to IExample.MyMethod. Resharper's Go To Definition would go to ExampleInAction.MyMethod, which is incredibly useful, but I don't want to pay for a Resharper license for just one feature, and I find the rest of Resharper largely intrusive.
Does anyone know of a plugin or something that will give me this single, amazing feature?
Thank you.
If you are working in VS 2013 - you can use Implementator extension, that adds menu command "Go to implementation" to context menu (which also can be manually bound to any shortcut you want).
If you are working in VS 2012 or 2010 - make a comment here, so I can notify you when this extension will be awailable for those versions, as I am planning to port it to VS 2010 and 2012 some time during next two weeks.
I am following guidelines given at This location, this link mentioned that "Move to Another File" option will be displayed, but I did not see it. I am using latest version as -
JetBrains ReSharper 8.2.2 Full Edition
Build 8.2.2000.5102
with visual studio - Visual Studio 10.0.40219.1.
Is there any issue with this feature?
This is not a issue. This happen when the type which we are moving is/are deeply nested within class e.g.
namespace MyNamespace
{
class A
{
enum B
{
}
}
}
. So first, re-factor the code to move that type(enum B) to outer name space(MyNamespace) and then again re-factor it to move required file, you will see menu here. :) :)
When I type the name of a class without specifying the full namespace and the class is not made available by the using statements, Visual Studio guesses which class I mean and shows the fully namespaced class name in a hint.
For example:
If I click it it adds the necessary using statement.
How can I select that hint using the keyboard?
So it turns out that this actually a ReSharper feature (not something that is built into Visual Studio) and I can press Alt+Enter to select it.
How can I check public interface of a class in Visual Studio to understand what really class can do?
In Eclipse I can use "Outline" pane for that.
Have a look at this Post
Productivity Power Tools Solutions Explorer should do the trick.
Maybe you can refer at this
Otherwise you just need to right click on the class name in the interface and choose "Go to definition".
Right click under the interface name and "Go to definition"
In Visual Studio 2008, when I print code with "hide collapsed region", the print result would include the region header name.
For example, if the code looks like this:
using ...
namespace Foo
{
#region MyRegion1...
#region MyRegion2...
public void SomeAction{}
}
In Visual Studio 2008 print, it looks like:
using ...
namespace Foo
{
MyRegion1
MyRegion2
public void SomeAction()
}
However, in Visual Studio 2010, it looks like:
using ...
namespace Foo
{
public void SomeAction()
}
Notice that the region name is not printing, but it leaves an empty space. Is this a bug in VS 2010, or it is redesigned to hide the entire region with just a blank space. I can't find any option to change this behavior.
What you describe also happens with my VS 2010 installation. I assume that this is by design (or perhaps by thoughtlessness, although that seems hardly believable, since they included this as a feature through an explicit checkbox option).
FYI, I tried changing this behavior through modifying the printer syntax highlighting settings, but to no avail.