Reputation: 15086
I have a class with lombok annotation (either @Value
or @Data
) and I am looking for an easy way to find usages of the auto generated constructor.
What I can do now is to find a one use of the constructor, put the cursor there and run 'Find usages' command and I get the results I want.
However I would like to do this directly from the class declaration. Is there a way to do that?
Upvotes: 21
Views: 5591
Reputation: 15086
I have finally found an acceptable solution to this:
@Builder
is present).Upvotes: 39
Reputation: 326
You can search for usages of the type (the class declaration). IDEA will display the usages grouped by usage type. There you will find "new instance creation".
This works for me with IDEA Ultimate 2016.3 and lombok plugin.
Upvotes: 1
Reputation: 26482
Not as easy as Find Usages, but you could use Structural Search for this. Use the button Copy existing template...
and choose new expressions
:
new $Constructor$($Argument$)
Edit variables to set the text/regexp of Constructor
to your classname.
Upvotes: 2