Visual Studio“转到实施”
在方法调用上单击鼠标右键,我们会看到一个上下文菜单,其中包含“转到定义”和“转到实现”选项等选项。
为什么有时会缺少“转到实施”选项?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
对于 Visual Studio 2015,有以下扩展:转到实施
它是一个扩展,允许转到所选类、方法或属性的实现(在使用接口时很有用)。与 ReSharper 功能类似。
它还支持多种实现
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
当然已经存在于 Visual Studio 中!从那时起它就在那里。
右键单击您的代码(例如:属性)并选择“查看调用层次结构”。在 Call Hierarchy 窗口中选择 Implements 文件夹。
你就在那里。为什么要Reshaper???
当然,并不像 resharper 的实现那么复杂,它允许直接询问接口,但只有该接口的属性或方法就足够了。例如:
右键单击属性(任何位置 - 类内部或接口内部)并选择“查看调用层次结构”,应该说明哪个类实现它们,从而说明整个接口。
一开始我们都喜欢Resharper,随着时间的推移,我们都讨厌它!
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:
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 !
此 ReSharper 上下文菜单项“转到实施”仅在以下情况下显示基础成员有一个实现。
它并没有出现在每个地方,因为 ReSharper 没有发现自己位于已实现的基础成员上。
http://www.jetbrains.com/resharper/features/navigation_search.html#转到实施
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
我认为当您单独加载不属于项目的文件时,有时会发生这种情况。当您创建 VC++ 项目时,Visual Studio 会生成一个智能感知数据库。旧版本为 *.ncb,2010 年为 *.sdf
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