October 10th, 2024

Java on Visual Studio Code Update – September 2024

Nick Zhu
Senior Program Manager

Hi everyone, welcome to the September update for Visual Studio Code for Java! In this blog, we will cover some important Spring feature updates and Gradle enhancements, let’s get started!

Spring Updates

Explain SpEL expressions, query statements, and AOP pointcut expressions with GitHub Copilot

SpEL expressions, query statements, and AOP pointcut expressions can sometimes be challenging to craft, but if you are using GitHub Copilot in your Visual Studio Code environment, the Spring Tools now show code lenses above these expressions that allow you to quickly let GitHub Copilot explain those statements for you. The corresponding prompt is crafted in a way to provide a nice summary, followed by a more detailed explanation. Here’s a demo.

Explain with copilot

Syntax highlighting and validation for CRON expressions

CRON expressions, when used inside the `@Scheduler` annotation, can now show up with syntax highlighting and error markers in case the syntax is not correct. Here’s a demo.

CRON scheduler

New inlay hints for query parameter names

Query parameters that use a ordinal to refer to a specific parameter of the query method now get an inlay hint, showing you the name of the resolved method parameter that the ordinal refers to.

Query parameter inlay hint

More Spring Annotations got content-assist, go to definition, and find references support

Working with Spring annotations in Java source code gets faster and easier with every release. The latest Spring Boot Tools add advanced features for:

  • @ContextConfiguration (auto-completion and go to definition support for xml config files supported)
  • @ConditionalOnResource (auto-completion and go to definition support for resource files supported)
  • @Named (auto-completion, go to definition, find references, and bean symbols for bean names supported)
  • @Inject (supported for injection points and spring file and workspace symbols supported)
  • @Resource (auto-completion, go to definition, and file and workspace symbols supported)

To use all the new features above, make sure you install the Spring Boot Extension Pack.

Gradle Updates

Android Build Variant Support in Gradle Extension

Thanks to the community, the Gradle extension now has the Build Variant support for Android projects in Visual Studio Code Java. Build variant is a nice feature provided for Android developers to configure different kinds of applications from a single projects.  Huge thanks to @Tanish-Ranjan for providing the implementation.

Support hierarchical tree structure in Gradle Task Explorer

We have also made some improvements visualizing project’s structure in Gradle Task Explorer. The latest release will display the project structure in a tree view in the extension.

Gradle

Install Extension Pack for Java

To use all features mentioned above, please download and install Extension Pack for Java on Visual Studio Code.

Extension pack for Java

If you are a Spring developer working on a Spring Boot application, you can also download the Spring Boot Extension Pack for specialized Spring experience.

Spring boot extension pack

Feedback and suggestions

As always, your feedback and suggestions are very important to us and will help shape our product in future. There are several ways to give us feedback

  • Leave your comment on this blog post
  • Open an issue on our GitHub Issues page
  • Send an email to: vscjfeedback@microsoft.com

Resources

Here is a list of links that are helpful to learn Java on Visual Studio Code.

Author

Nick Zhu
Senior Program Manager

Developer at heart

0 comments