Share this article

Latest news

With KB5043178 to Release Preview Channel, Microsoft advises Windows 11 users to plug in when the battery is low

Copilot in Outlook will generate personalized themes for you to customize the app

Microsoft will raise the price of its 365 Suite to include AI capabilities

Death Stranding Director’s Cut is now Xbox X|S at a huge discount

Outlook will let users create custom account icons so they can tell their accounts apart easier

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

3 min. read

Published onJune 4, 2024

published onJune 4, 2024

Share this article

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

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?

How does the feature work?

On your Java class, you will see a new CodeLens text above the name of the classRewrite 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) versionExtension Pack for JavaandGitHub Copilotextensions 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:

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)

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)

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)

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.

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

Srishti Sisodia

Windows Software Expert

Srishti Sisodia is an electronics engineer and writer with a passion for technology. She has extensive experience exploring the latest technological advancements and sharing her insights through informative blogs.

Her diverse interests bring a unique perspective to her work, and she approaches everything with commitment, enthusiasm, and a willingness to learn. That’s why she’s part of Windows Report’s Reviewers team, always willing to share the real-life experience with any software or hardware product. She’s also specialized in Azure, cloud computing, and AI.

User forum

0 messages

Sort by:LatestOldestMost Votes

Comment*

Name*

Email*

Commenting as.Not you?

Save information for future comments

Comment

Δ

Srishti Sisodia

Windows Software Expert

She is an electronics engineer and writer with a passion for technology. Srishti is specialized in Azure, cloud computing, and AI.