May update for Visual Studio Code added AI-related feature for Java developers

To use it, you need GitHub Copilot license and Insider (Pre-release) version Extension Pack for Java

Reading time icon 3 min. read


Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team. Read more

May update for Visual Studio Code added AI-related feature for Java developers

Microsoft added an exciting AI feature for Java developers on Visual Studio Code, Rewrite with new Java syntax with Copilot.

You get this feature with the insider (pre-release) version of the extension pack for Java. It is seamlessly integrated with GitHub Copilot, so you need a GitHub Copilot license to use it.

How does the feature work?

On your Java class, you will see a new CodeLens text above the name of the class Rewrite with new Java syntax. Once you click t, it will initiate the inspection on the current Java class

Once the examination is done,  Visual Studio Code will display some improvement suggestions and point users to the location.

For each suggestion, you will get an additional CodeLens displaying the solution and changes to be made. Clicking on the CodeLens will invoke the GitHub Copilot inline chat box.

You can then see the difference between your code and the suggestion and choose to Accept or Discard the suggestion. If you accept the suggestion, the workflow will be completed.

In a different scenario, if a code is complex, you may not want to inspect the whole class at once. So, with the feature, you can also inspect a part of the code. To do that, select the code you want to inspect, then click the lightbulb icon on the left and choose Rewrite with new Java syntax.

To use the new feature, you need to install both the Insider (Pre-release) version Extension Pack for Java and GitHub Copilot extensions with a GitHub Copilot license.

What are the Spring updates?

Along with this, Microsoft also added Spring updates to Visual Studio Code, here is what the release notes say:

JPQL syntax highlighting

The Spring Boot Tools extension now features syntax highlighting for JPQL query strings. The syntax highlighting works for @Query annotations inside of Java source files as well as for named query property files. This makes reading those query strings much easier. (screenshot JPQL query syntax highlighting)

Add Starters directly from within `pom.xml` files

We added a clickable hint to pom.xml files of Spring Boot projects, directly  in their dependency section. This clickable hint directly invokes the support to add additional Spring Boot starter modules. This improves discoverability and usability of this feature and makes it super easy to find and use. (screenshot add pom starters)

Dashboard shows active profiles

The Spring Boot Dashboard now shows the active profiles of a running Spring Boot application directly side by side with the port the app runs on. This is available in the pre-release version. (screenshot active profiles in dashboard)

Automatically convert application properties to YAML and back

The Spring Boot tools now offer actions to automatically convert `application.properties` files to YAML format and the other way around. This makes the switch to your (newly) preferred format super easy.

Performance and footprint improvements

The indexing infrastructure for Spring projects got improved. Previously, the mechanism was able to index about 6.5k Java source files inside of a single project before running out of memory. The latest versions can now index up to 60k Java source files instead within the same memory constraints. In addition to that the initial as well as ongoing performance of reconciling Java source files for Spring specific validations is now twice as fast as before.

What do you think about these changes in Visual Studio Code, especially Rewrite with new Java syntax? Share your views with our readers in the comments section below.

More about the topics: Java, visual studio code

User forum

0 messages