January 31st, 2023

Java on Visual Studio Code Update – January 2023

Nick Zhu
Senior Program Manager

Hi everyone, welcome to our first blog post of 2023! There are several exciting updates related to Spring extensions, code editing and performance that we wanted to share with you, so let’s get started.

New Walkthrough for Spring Extension Pack

Walkthrough is a multi-step, wizard-style experience for onboarding users to an extension featuring rich content. Ever since Visual Studio Code introduces the walkthrough format for extensions, it has become widely popular. Since we have made a lot of improvements for Spring extensions, we also made a refresh for the existing walkthrough for the Spring extension pack.

The new walkthrough reflects our latest features such as beans and API mapping views as well as live memory graph from the Spring Boot dashboard. It also contains more concise and intuitive information so new users can learn about how to use the Spring extensions in a smooth way. Here’s a demo for the new walkthrough.

Spring new walkthrough

The new walkthrough consists of four steps

Step 1 – Start with a Spring Boot Project.

In this step, you can either use the Spring Initializer to create a project from scratch or clone an existing sample project from GitHub.

Step 2 – Explore your projects

Once you have a project, there are different tools in the extensions that can help you quickly navigate to Spring symbols. Beans and endpoint mappings are part of the Spring Boot dashboard UI layout and you can directly jump to the view in this step.

Step 3 – Run your projects

This step explains how to run the project. To enjoy the most Spring features from our extensions, you can click the Play button from the Spring Boot dashboard. Alternatively, you can use other methods described in this step.

Step 4 – View live information from your running application

A unique feature of our tools is the ability to visualize the live data for a running Spring application. The see the live data, run the application from the Spring Boot dashboard. You will be able to see the beans, endpoint mappings as well as newly added live memory information.

Case sensitive code completion

When editing code, sometimes developers want case of the letters to be taken into consideration. We have heard this feedback from the developers and have added this feature in our extension. Here is a demo for this feature.

Case sensitive code completion

Please note that this feature is currently available in Insider version only, and will later be released on Stable version. To switch this feature on or off, please go to the settings and search for “match case”. Here’s the screenshot.

Code completion setting

Performance improvement – Reduce project index time by sharing index files 

Long project index time is an issue we constantly hear from developers, and we’ve been looking for a good solution. Recently, we have made an improvement from the upstream to reduce the overall project index time. Previously, the index files for each workspace are stored separately, and require rebuilding all indexes during project imports, that could result in a long indexing time. However, after the improvement, we chose to store the indexes for libraries in a common location so that different workspaces can reuse the same index files. It saves the time for duplicate indexing of common libraries (such as JDK and popular libraries) and significantly improves indexing performance.

We have ran some experiments and here’s the performance benefits that we can get the share indexes.

Project (Spring pet-clinic) Performance
Without shared-index 20s
With shared-index 6s

If you are interested in the technical details of the improvements, you can see the following PRs:

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.

Category
Java

Author

Nick Zhu
Senior Program Manager

Developer at heart

3 comments

Discussion is closed. Login to edit/delete existing comments.

  • Sandip Chitale

    I have a VSCode extension for Java debugger called vscode-java-debug-ext on market place – which basically adds some context menu commands in variables view. I would like to extend it with more features available in JDWD/JWS like showing references, instances etc. It would be nice with the nodes in variables and watch view make available in the node context, it will be great.

  • Sandip Chitale · Edited

    Looking forward to fast indexing. Here is one idea. Most libraries also publish -source.jar and -javadoc.jar classifiers on Maven repositories. I wonder if libraries also start publishing a standard format -index.jar files on Maven repositories. And then tools like VSCode or Eclipse or IntelliJ or Netbeans or ... do not even have to build and have shared indices on built on developer machine. It will then become a matter of composing the -index.jar files for...

    Read more
    • Nick ZhuMicrosoft employee Author

      Thanks for the suggestion Sandip. Have you brought up this idea in other places in the Java community by any chance?