Dariusz
Dariusz

Reputation: 22241

Eclipse with Lombok - search for getter and setter usages

I'm using Eclipse with Lombok. The getters and setters are generated properly but they are not visible in class body (that's the whole point, I know). However, because of that, I am unable to execute a search for usages of a getter or a setter from inside the class. So if I want to check what and where actually sets a particular value of a field, I have to execute a String search for the getter name, which is slow and may give bad results (for a field of the same name in another class, for example).

Is there a way in Eclipse to look for a getter/setter usage for a field for lombok-generated methods?

Upvotes: 53

Views: 13509

Answers (3)

Kiran
Kiran

Reputation: 1

Apart from finding the method in outline and then right click and find references, there is no other option as of now. Same holds good for constructors provided by lombok.

Upvotes: 0

hero
hero

Reputation: 11

if you cant see getter and setters in outline tab.just restart the IDE.And also before importing the jar to IDE,Run the jar file and specify the IDE.exe file to it.

Upvotes: -3

Florent Bayle
Florent Bayle

Reputation: 11890

You can use the Outline view: outline view showing getter/setter

Right-click on the method in the Outline view, and use "Open Call Hierarchy".

An other way to do it is to right-click on the annotation (@Setter for instance), and use "Open Call Hierarchy" on it, but it may not work with some annotations (like @Data).

Upvotes: 77

Related Questions