OK, I don't know what exactly happens so I'll have to write a long text to explain it, here it goes.
Part 1 - The problem
I've created a brand new spring project using the vscode spring boot initialzr extension and run the project successfully. Then, I added your extension so I could use lombok on my project. Vscode asked me to restart/reload and as soon as vscode opened I received the message "Language Support for Java Server crashed 5 times in the last 3 minutes".
Checking the project folder, I found out that the JVM crashed and several core dump files were created in the folder, each one with 1GB+ size. First I thought it was a problem with that Java Server extension and/or with my project. But after trying several things, to solve it there was nothing left but remove your extension.
I removed it and found another problem which was already reported in this issue redhat-developer/vscode-java#1175 and apparently is not fixed yet. I did what was suggested in that issue and removed the JVM parameters referencing your extension and the project opened again without crashing the JVM.
NOTE: anyone reading this issue and having this problem on Linux, the path for the file that need to be fixed is $HOME/.config/Code/User/settings.json
Part 2 - The solution
I obviously couldn't build the project because lombok was not on my classpath anymore. This was when I tried to do something very specific (don't know why, just luck I guess) and that solved the problem for me.
-
I ensured that your extension was completely removed checking the vscode extensions folder (on Linux $HOME/.vscode/extensions
)
-
I removed all Java and Spring extensions using the vscode extension manager
-
After removing all these extensions I closed and reopened vscode to check if no errors were occuring. Everything was OK
-
I reinstalled only your extension using vscode extension manager, but this time, when vscode asked me to restart, I denied and closed vscode manually to prevent it from opening again
-
With vscode closed I downloaded the last version of Lombok (1.18.18) and replaced the jar on your extension folder with it
-
Then I reopened vscode and reinstalled all Java and Spring extensions
And voila!! No errors, the code started compiling and I could run the project normally
Phew, that was a long text, thanks for your patience!
Part 3 - The conclusion
After thinking for a while why this worked, a light bulb popped over my head. Here's what I think it's happening. When we include lombok in the project dependencies using gradle, usually this is done this way:
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
If you pay attention closely, you will see that the version of Lombok is not specified, which probably means that Gradle/Maven downloads the latest version and add to the classpath. This is the version that will be used to compile the project.
When I was replacing your jar by the one downloaded from the lombok site, I noticed that the size of your jar was slightly smaller. This makes me think that your jar is an older version. Probably what happens is that your jar expects an older version of lombok in the classpath that matches it, but since gradle grabbed the latest one from the repository, a JAR HELL occurred and crashed the JVM!
Oh dear! I should have listened to my mom and become a lawyer! Maybe I should sell my laptop and buy a popcorn machine to sell popcorn on a square.
Anyways, I have nothing to support this theory, but it's the best that my brain can do for now, at 1:08pm! Thank you for your great work until here, your extension is very useful and I'll be very happy if you find a way to help us all.