Lombok support

Fred Bricon edited this page May 1, 2018 · 3 revisions

In order to enable Lombok support, you need to edit the java.jdt.ls.vmargs setting in VS Code preferences:

{
"java.jdt.ls.vmargs": "-javaagent:/path/to/lombok.jar -Xbootclasspath/a:/path/to/lombok.jar"
}

Paths containing spaces should be surrounded by (escaped) double quotes:

{
"java.jdt.ls.vmargs": "-javaagent:\"/spaced path/to/lombok.jar\" -Xbootclasspath/a:\"/spaced path/to/lombok.jar\""
}

The a: prefix in the Xbootclasspath flag is critical, make sure it's added.

Alternatively, there's a simpler method of enabling lombok support, via the Lombok Annotations Support for VS Code extension.

Known issues

  • Lombok versions prior to 1.16.21 prevent the formatter to work properly. Using the lombok-edge (1.16.21) jar fixes this issue.
  • Lombok is currently not fully compatible with Java 9 and 10
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.