Microsoft has taken over maintenance of the vscode-lombok extension, originally created by Gabriel Basilio, which supports the use of Project Lombok in VS Code. In addition, the Red Hat Java Language extension for VS Code now supports Lombok by default, following a merge at the end of last month.
Project Lombok lets developers write more concise code via use of annotations. An example is the @Getter/@Setter annotation which generates a getter, a setter and a matching field automatically. Unlike IDE tools that generate code, the Lombok annotations remain as annotations, so that the code remains concise. The @Data annotation is another example, combining several Lombok annotations into one, enabling multiple fields, getters and setters to be added to a class in one line of code.
Lombok is a long-established project and understandably popular with Java developers, but it has been troublesome for those using VS Code. It is challenging for the IDE since Lombok works at compile time, whereas static analysis tools in the editor look at the Java code. Issues included the Java language server crashing, repeated out of memory errors, and incorrect code highlighting.
Senior program manager Nick Zhu has posted saying the recent extension improvements mean that “you shouldn’t experience any weird issues with Lombok anymore.” Basilio has moved on from the vcode-lombok extension, he added, and “Microsoft will maintain the extension from now on,” including adding new features if needed.
Other new features in the VS Code Java support include the ability to drag and drop classes between packages, function breakpoints (break on specified methods without having to manually set multiple breakpoints), and additional “quick fix” code actions to generate code.