是否有 Resharper 插件(或类似插件)可以让您找到从方法 A 到方法 B 的代码路径?
我的代码中有一个方法,我们称之为 MethodA,并且我知道在某个时刻该方法的执行将导致另一个方法(我们称之为 MethodB)执行。
我想知道从 MethodA 到 MethodB 采取什么代码执行路径。
是否有 Resharper 插件(或其他插件,但首选 Resharper)可以执行此操作?
I have a method in my code, let's call it MethodA, and I know at some point the execution of that method will cause another method, let's call it MethodB, to execute.
I'd like to know what code execution path is taken to get from MethodA to MethodB.
Is there a Resharper plugin (or something else but Resharper is preferred) that does this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我相信 ReSharper |检查 | Incoming Calls(当您的光标位于其声明处的
MethodB
名称内时)是您在 ReSharper 中获得的最接近的结果。它有效,但您必须自己在结果中找到“MethodA”。I believe
ReSharper | Inspect | Incoming Calls
(while your cursor is within the name ofMethodB
at its declaration) is the closest you're going to get in ReSharper. It works, but you'll have to find "MethodA" in the result yourself.Visual Studio 中有一个功能(我不确定哪个版本有这个功能),它允许您绘制该方法的序列图。您可以使用它来查找从方法 A 到另一种方法 B 的路径,
请参阅 图 10:为方法生成序列图
There is a feature in Visual Studio ( I am not sure which version have that) which allows you to draw sequence diagram of that method. You can use that to find path from method A to another method B
see Figure 10: Generate Sequence Diagram for a Method