Microsoft says no more “weird issues” with VS Code and popular Lombok Java library

Microsoft says no more “weird issues” with VS Code and popular Lombok Java library

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.

The Red Hat Java language extension for VS Code now has Lombok support built in

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.

Although VS Code is the most popular IDE overall, this is unlikely to be true for Java development. According to this report, based on job ads, Stack Overflow questions, and Google searches, Eclipse is the most popular Java IDE, followed by JetBrains IntelliJ and VS Code in third place. Considering that both Eclipse and IntelliJ are built with Java, that is not surprising. Nevertheless, the Red Hat Java language extension for VS Code reports nearly 17 million downloads, and developers may put up with inferior Java support because they like using the same IDE across multiple languages, or have projects which combine Java and JavaScript or TypeScript where VS Code is strong.