News

Microsoft Announces Built-in Support for Lombok in VS Code for Java

The latest update to Microsoft's popular Visual Studio Code (VS Code) for Java source code editor includes new built-in support for the Lombok Java library tool, as well as some fundamental user experience improvements, the company announced this week.

Project Lombok is designed to reduce boilerplate code, employing annotations to streamline things like getters and setters. This approach also improves the readability of the source code and saves space by reducing the lines of code. Lombok adds the boilerplate codes at compile time in the ".class" file instead of the source code.

Although the Lombok library has been used by Java coders in VS Code, that use has been fraught with problems when combined with the Java on VS Code dev teams' tooling. Now, Microsoft has cleaned things up and is taking over the community-developed extension from original author Gabriel Basilio for maintenance and new feature development as needed.

The Lombok extension has been installed more than 541,000 times, earning an average 4.3 rating (scale 0-5) from 17 developers who reviewed it, Nick Zhu, senior program manager in Microsoft's Developer Division, reported in a recent blog post.

"Lombok is a popular Java library that makes your coding life easier, and we have been consistently hearing from developers that our extensions don't work well when they have Lombok dependency in their projects," Zhu wrote. "Starting from a few months ago, we started investigating this and now we have fully enabled built-in support for Lombok within our extensions. You shouldn't experience any weird issues with Lombok anymore."

With the built-in support of Lombok, developers:

  • Will be reminded that Lombok support needs to be enabled when they open a project for the first time and the dev team's Java extension sees that the project has a Lombok dependency
  • Can see the current Lombok version and status in the language status bar after enabling the Lombok support, while licking on the item takes the developer to where the Lombok version is configured, letting them easily change the Lombok version
  • Can toggle Lombok support on and off with a new setting

Beyond the Lombok support, the team sought to improve the user experience with:

  • Drag-and-drop support in the Java Project explorer
  • A new setting that lets developers disable inlay hints under some circumstances
  • The ability to set a function breakpoint by clicking the "+" button in the Breakpoints view and entering a fully qualified method name from a Java class
  • More code actions for the Quick fix prompt
  • Zhu also announced another improvement to Spring functionality: the bean dependency view. "As a Spring developer, bean dependency is something that we deal with very often and sometimes we might want to visualize that," he said. "We added this feature to Spring Boot dashboard. It will become available when you launch the application from the Spring Boot dashboard, and click the inline button on the right. From there, you can go two directions. You can either see what this bean is injected into, or see what this bean is depending on."

About the Author

David Ramel is an editor and writer for Converge360.