In Eclipse, how can I find all usages of a function in a Java app? What is the shortcut for that?
I tried with Ctrl+H to search by method, but it return me all methods with the same name.
Use "Java Search" in the search menu or move the caret on the function name in the source and press Ctrl+Shift+G (-> search for reference in Workspace). [EDIT] If you don't know in which class the function is, then use the text search (which is called "File search").
Press Ctrl + H or look in the Search menu for Search>Search or Search>File depending on version. At bottom of dialog box, click Replace... There you'll find the replace in files functionality.
When you do a text-based search in eclipse (using the flashlight button at the top of the screen and selecting the right tab) there's a "Replace..." button at the bottom of the dialog. Press that, instead of search, and you can do a global find and replace.
You can open any method or type in your workspace using the "Open Type" wizard or the "Open Method" wizard. -Or- press Ctrl+Shift+T (for a type) or Ctrl+Shift+M (for a method). The "Open Type/Method" dialog will appear. If a type/method was previously selected in the editor or outline views, it will be displayed.
You can find a menu entry in the context menu, when right clicking on the function. You can also press Ctrl+G when the cursor is above the function or member. Not every project and file type supports this feature. For example, EPIC Perl only supports finding the definition of a function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With