如何仅查看 Resharper 中的公共方法?
当我按 Cntrl+F12 时,会弹出成员视图,其中显示我所在班级的所有成员。然后我可以向上或向下滚动或过滤搜索以选择我正在寻找的成员。
是否可以有相同类型的弹出窗口,但只显示我的类的公共方法?
When I press Cntrl+F12 I get the member view pop up which shows me all the members of a class I am in. I can then scroll up or down or filter the search to choose the member I am looking for.
Is it possible to have the same type of pop up but only show the public methods of my class?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不知道ReSharper中的解决方案,但Visual Studio的类视图(View->Class View)可以过滤公共成员。
但是类视图有一个缺点:您无法将类视图与编辑器窗口中的当前类同步。但是,如果您始终通过类视图导航到类,则可以使用其过滤器。
PS:由于所描述的缺点,我不使用类视图。
I don't know a solution in ReSharper but the Class View (View->Class View) of Visual Studio can filter public members.
But the Class View has one disadvantage: You cannot synchronize the class view to current class in editor window. But if you always navigate to your classes by Class View you can use its filter.
P.S.: I don't use Class View because of the described disadvantage.
您可以限制工具栏显示的内容。
You can restrict what is shown from the toolbar.
因此,看看其他答案,我发现有时您需要一个更简单、更快速的解决方案,该解决方案适用于不是很大的文件。
Ctrl+M、Ctrl+O
public
搜索将突出显示方法/变量/类/等的所有公共定义,并且因为它已折叠,您可以快速浏览您的定义。
So looking at other answers, I see that sometimes you'd want a little bit simpler and quicker solution which works well for not really huge files.
Outlining -> Collapse to definitions
, orCtrl+M, Ctrl+O
public
Search will highlight all public definitions of methods/variables/classes/etc, and since it's collapsed you can quickly skim over your definitions.