[英]How to find where a method is used in Java project
I am working on learning a project which was already created by someone else. 我正在研究别人已经创建的项目。 It was not followed a proper coding method (no comments and so on). 没有遵循正确的编码方法(没有注释等)。 Im finding it difficult to find where a method is used. 我发现很难找到在哪里使用一种方法。 I tried "find" but as it searches only a particular class im unable to get the answer. 我尝试“查找”,但由于它仅搜索无法获得答案的特定类。 Im working in eclipse. 我在日食中工作。 So can anyone please help me out. 所以任何人都可以帮助我。
You can select method that you want to find and use "Ctrl +H" and references search. 您可以选择要查找的方法,然后使用“ Ctrl + H”并引用搜索。
I hope this can help you. 希望对您有所帮助。
Right click on the method in the editor, and from the pop-up menu select 右键单击编辑器中的方法,然后从弹出菜单中选择
depending on whether you want to search only in the current project, or in the entire workspace. 取决于您只想在当前项目中还是在整个工作空间中进行搜索。
For the find references in workspace option, the default keyboard shortcut is: Shift + Ctrl + G 对于在工作空间中查找引用选项,默认键盘快捷键是: Shift + Ctrl + G
After invoking the command, the Search window will display an overview of all locations where the method is used. 调用命令后,“ 搜索”窗口将显示使用该方法的所有位置的概览。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.