View lombok generated code in IntelliJ IDEA
Asked Answered
K

4

97

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.

Knuth answered 10/4, 2016 at 5:43 Comment(4)
#29980633Sweetandsour
Take a look at this answer. https://mcmap.net/q/219052/-intellij-idea-cannot-see-lombok-generated-code-duplicateMineral
Not sure how that addresses the question. I was hoping to see the generated source inline in the source file.Knuth
did you find anything as of now?Behan
B
117

With the Lombok plugin (starting with v0.8.6), "Lombok" and "Delombok" menu items are available in the "Refactor" menu.

IDEA screenshot showing the Lombok & Delombok menu items

Behalf answered 1/4, 2017 at 21:55 Comment(3)
thanks jjd. what would be very helpful to know is that would re-Lomboking using the above plugin options, just revert the class to what it was...cause the Lomboking options all start with Default...I dont want to change the class from a bespoke Lombok to a default lombok...sorry I am a lombok newbie.Mosesmosey
Just look at the expanded menu right under the one shown, i.e. Delombok. That's what you're looking for.Rother
Does not answer the questionNovercal
M
22

Find generated class in folder target/././classname.class and open it in IntelliJ IDEA.

Markhor answered 28/6, 2021 at 4:55 Comment(2)
From Review: The question is about a solution for seeing the lombok generated code inline in the original source file in that project.Lacquer
Actually this is what I'm looking for. @Vasily Pudikov, you got my up vote. :)Cardinalate
F
15

Lombok comes with a 'delombok' feature that can be used as follows:

java -jar lombok.jar delombok -p MyJavaFile.java
Freetown answered 16/3, 2017 at 9:42 Comment(1)
Very aware of that as mentioned in the question. I'm looking for something in the IDE where I can flip a toggle or something and see the lombok generated code inline in the original source file in my project.Knuth
D
1

For anyone who arrived here looking for a "delombok" shortcut, one can be created here:

enter image description here

Dermis answered 11/11, 2022 at 17:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.