Spring Functionality, Debugging Improved in Java on VS Code Update
The regular monthly update to Java on Visual Studio Code sees multiple improvements to Spring functionality along with a couple community contributions that enhance debugging.
The dev team maintains Java tools available in the code editor's marketplace, including the Extension Pack for Java, which has been installed nearly 14.5 million times. The Spring Framework, meanwhile, is a Java platform that is also popular, providing comprehensive infrastructure support for developing Java applications.
In the August 2022 update, the team provided a better getting-started experience for Spring Initializer, which is used to create a new project, in part by generating a HELP.md file that provides useful information for coders looking to get started with Spring.
"Previously, many developers would not realize this file was there or it was simply ignored," said Microsoft's Nick Zhu in an Aug. 25 announcement. "It would be helpful if this file can be automatically opened in Visual Studio Code. This feature is added recently so that Spring developers can have a more smooth getting started experience."
To use the new features, developers need to install the Spring Boot Extension Pack in addition to the Extension Pack for Java.
Using the new Spring Initializer feature is illustrated in this animated GIF:
Another new feature affects Spring beans, which are objects that form the backbone of an application, managed by the Spring IoC container.
"When developer starts a Spring app from the Spring dashboard, just wait for the beans to connect to the live process and go 'green,' then the bean property information will automatically appear right next to the bean name," Zhu said. "You will see if the bean is a singleton, prototype and so on. If a bean is defined by developer and not by Spring framework, you will also see 'defined' as well."
Microsoft also beefed up functionality for Maven and Gradle. Maven allows a library consumer to override a dependency by version. Gradle, often used with Maven, supplies customizable dependency selection and substitution rules, which can help developers handle unwanted project-wide dependencies.
"We have heard from developers that they want better Maven and Gradle integration in our extensions, and this is one of the areas we will keep working on," Zhu said. "In our latest release, we have added Maven and Gradle menu items in our Java Project Explorer so that developers can directly access certain actions in a more convenient way. To use this feature, developers just need to right click on an application node inside the Java Project Explorer view in a Maven or Gradle project and find the actions at the bottom of pop up menu."
On the debugging front, the two community contributions improve support for method breakpoints and also show target VM exceptions as result in evaluate requests.
David Ramel is an editor and writer for Converge360.