Reputation: 2046
I have the lombok plugin setup in IntelliJ and my code builds fine. I can see the lombok generated methods in the structure view. What I want is some way to actually see the source lombok generates for each of the methods. I realize I can delombok the file but I'm wondering if there is some way I can flip a switch to show or hide the lombok generated code.
Upvotes: 102
Views: 67658
Reputation: 635
I had various undesirable effects with delombok. Therefore, here is an alternative with Intellij on-board tools:
First: Make sure that the target folder is not among the excluded folders of your project (you can check that at "Project Structure (F4) / Project Settings / Modules").
With the lombok annotated type highlighted you can press shift twice to open the search all dialog. The according .class resource should now appear under the items in the search result list. If you select that item a tab opens with the decompiled code.
In both cases it is mandatory of course, that lombok generation (for example with maven) took place beforehand.
Upvotes: 0
Reputation: 18986
You can use "Delombok" IntelliJ plugin.
After installing it, given any Java file which contains Lombok annotations:
Refactor
Delombok
Sample:
Upvotes: 0
Reputation: 2288
With the Lombok plugin (starting with v0.8.6), "Lombok" and "Delombok" menu items are available in the "Refactor" menu.
Upvotes: 119
Reputation: 2125
Lombok comes with a 'delombok' feature that can be used as follows:
java -jar lombok.jar delombok -p MyJavaFile.java
Upvotes: 17
Reputation: 149
For anyone who arrived here looking for a "delombok" shortcut, one can be created here:
Upvotes: 1
Reputation: 261
Find generated class in folder target/././classname.class and open it in IntelliJ IDEA.
Upvotes: 26