Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find all occurrences of a function in Eclipse

Tags:

java

eclipse

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.

like image 209
JaneNY Avatar asked Jan 31 '11 12:01

JaneNY


People also ask

How do I find a specific function in Eclipse?

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").

How do you get find replace in Eclipse?

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.

How do I do a global search and replace in Eclipse?

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.

How do I get to source method in Eclipse?

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.


1 Answers

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.

like image 66
matthias.lukaszek Avatar answered Oct 11 '22 15:10

matthias.lukaszek