Lombok-related errors on Visual Studio Code with the extension installed
Asked Answered
T

4

12

I have decided I had enough of Eclipse's slowness and just moved everything to VSCode. I installed the java extension package as well as the Lombok extension.

My project worked perfectly fine in Eclipse and, although it does run fine, VSCode is finding thousands of errors obviously related to not finding the getter/setter methods that Lombok generates. My solution consists of two projects that both depend on a class library (the third project) which has a dependency for Lombok registered.

How can I get rid of these errors / make Lombok work properly in VSCode?

Thibault answered 1/4, 2019 at 15:20 Comment(0)
T
8

Seems like my issue was loading the 3 projects into my workspace before installing the Lombok plugin. I have removed the projects from my workspace and opened them again and the errors are gone.

Thibault answered 1/4, 2019 at 16:43 Comment(1)
+1 from me, it is also possible (now) to right click the pom.xml files and choose "Update project configuration" rather than removing the projects and re-adding them.Cotswolds
O
1

here the other way to clean the getter/setter errors :

  • under "Java Projects" section -> click "..."
  • Click "Clean Workspace"
  • wait the clean up process

it will reload the code and no more getter/setter errors

Overmaster answered 11/10, 2021 at 3:58 Comment(0)
B
1

For those that above answers did not work...

1.Install theses extensions:

imagem 1

  1. those like me have to use many JDK of differents versions, click here:

imagem 2

3.And the click here:

imagem 3

  1. You able to edit settings.json: to configure now the version of JDK, and the version of JDK used by support you VSCODE Version:

imagem 4

  1. Now reload the VSCODE and vou will by able to use in VSCODE lombok build in version, or configure manually your version, like this:

imagem 5

  1. Then open setting.json and turn java.jdt.ls.lombokSupport.enabled to true, if you want vscode use version of lombok included, ou turn enable to false, for you specific version of lombok:

imagem 6

Hope this can help someone. See more: link1 link2 link3

Bartonbartosch answered 2/5, 2024 at 21:21 Comment(0)
A
0

The above works but of course make sure you have the VS Code lombok plugin installed.

  1. press Ctrl + Shift + X to open the extension manager.
  2. Type lombok to find the plugin, and click install.
  3. Reload VS Code.
Aerobatics answered 23/5, 2022 at 14:19 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.