JaneNY
JaneNY

Reputation: 473

Find all occurrences of a function in 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.

Upvotes: 47

Views: 57906

Answers (5)

tonio
tonio

Reputation: 10541

Use Ctrl+G to find all uses of a function in the project.

Upvotes: 4

waldol1
waldol1

Reputation: 1881

This is hackish, but if you temporarily change the method signature, it will create compile errors, which are easy to find.

Upvotes: 7

DocFoster
DocFoster

Reputation: 471

Use Ctrl+Shift+G for search the whole workspace

Upvotes: 27

dogbane
dogbane

Reputation: 274532

Select a method and hit Ctrl+Alt+H to open its Call Hierarchy which will show you where the method is being called from.

Upvotes: 35

matthias.lukaszek
matthias.lukaszek

Reputation: 2220

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.

Upvotes: 37

Related Questions