90

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.

Mike Sweeney
  • 1,896
  • 2
  • 18
  • 20

4 Answers4

107

enter image description here

Just in case somebody ends up looking for an answer here. With lombok plugin starting with v0.8.6 it is possible.

jjd
  • 2,158
  • 2
  • 18
  • 31
  • 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. – Beezer Jul 17 '17 at 10:15
  • 13
    Just look at the expanded menu right under the one shown, i.e. `Delombok`. That's what you're looking for. – swalog Oct 06 '17 at 08:17
  • 4
    Does not answer the question – NickJ Apr 05 '22 at 09:06
17

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

Vasily Pudikov
  • 171
  • 1
  • 2
15

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

java -jar lombok.jar delombok -p MyJavaFile.java
Fede Garcia
  • 677
  • 11
  • 18
Rajesh Kolappakam
  • 2,095
  • 14
  • 12
  • 7
    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. – Mike Sweeney Mar 17 '17 at 03:59
1

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

enter image description here

Joseph Cass
  • 119
  • 1
  • 3