Nick zhu, Senior Program Manager, Developer Division at Microsoft

Hello and welcome to the July edition of Visual Studio Code Java update. In this article, we will share the progress of our overall product roadmap, and highlight our new testing experience, as well as improvements related to Maven and project management. Let’s get started!

New Java testing experience

With the release of the official version of Visual Studio Code 1.59.0, the new plug-in test API has been released from the pilot version to the official version. Since September 2020, after nearly a year and several iterations of polishing, both functionality and ease of use of the API have been greatly improved compared to the first preview version. Among them, Java Test Runner (included in the Java extension pack), as the first plug-in to adopt the Test API, also released the new 0.31.0 version, ushered in many new improvements and highlights in the function and user experience. Let’s take a look at the Java Test Runner plug-in and see what the new Test API can help the plug-in provide in the use scenarios being tested!

Brand new Testing Decoration

Users can now see a new row of Testing Decoration buttons in the left area of the editor. Clicking on the row will immediately run the corresponding test cases, and right-click to see more options. Unlike Code Lens in the past, it can be less intrusive to users in the editing area.

More powerful test browser

Testing Explorer is a new look, and users can now customize how the browser is displayed and sorted to suit different scenarios and habits. Users can also run or debug tests directly from the test browser.

In addition, the new test browser has built-in search bar support to help users quickly find target test cases and accelerate development efficiency.

Richer Test Message

The new test API allows plug-ins to embed test execution results and other content in the edit area, making it easier and faster to view errors and stack information:

To learn more about the features of the new test functionality, visit the official documentation

Maven relies on improved management experience

In addition to the test experience, we have made some improvements to Maven dependency management. Specifically, we have improved the Maven dependency tree interface to make it more user-friendly. In addition, we are aware that Maven dependency conflicts can sometimes be difficult to handle, and that sometimes Maven may not be able to resolve the conflicts automatically the way we want them to, which can cause errors when we run the application. As a result, we have made some changes to the Maven extension to better show how Maven resolves dependency conflicts in the interface. In addition, conflicts in Maven POM will appear intuitively in the Error Tab of Terminal. After the user clicks on these errors, Visual Studio Code prompts the developer to fix the conflict and select the dependency to use. The following figure shows an example of how to help users resolve conflicts quickly.

The project management

In addition to test and dependency management, we have improved functionality related to project management. Specifically, we fixed several issues where the project browser would not work properly. Here’s a list of the enhancements/bug fixes we’ve made.

  • When creating a project without a build tool, the output path is explicitly set by default (Issue #523)
  • Java Project Explorer extends unexpectedly while editing (Issue #502)
  • Cannot refresh automatically when removing packages from the Java Project Explorer (Issue #458)
  • When I save the file, “EXPLORER” automatically expands and displays (Issue #430)
  • Exception observed when opening a file not on the classpath (Issue #494)

Product roadmap progress update

Last month, we shared a roadmap for the months ahead. In the blog, we mentioned several areas as our focus

  • Continuous improvement of the basic development experience
  • Build tools (Maven/Gradle)
  • Remote development/Codespaces support
  • test
  • security
  • Debugging (exploring virtual threads)

As part of our Blog for July, we wanted to update you on what’s going on. The words marked in green are areas where we have made important progress. As mentioned in the previous section, we have taken a big step in improving the overall testing API experience. In the coming months, we will continue to add more test-related features (such as test coverage). In terms of building tools, we are constantly improving our Maven experience, while we continue to work on better Gradle support. Finally, we have supported trusted/untrusted workspaces in the Java development environment, so we have made significant progress in security.

For the other areas mentioned in the roadmap, we have been actively improving the experience and will provide updates as important progress is made.

Feedback and Suggestions

Please actively use our products! Your feedback and suggestions are very important to us and will help us do better. There are several ways to give us feedback

  • Leave a comment on this thread
  • Create an Issue on our GitHub repo

resources

The following links and resources can help you better understand Java on Visual Studio Code

  • Learn more about Java in Visual Studio Code
  • Step-by-step exploration of the Java tutorial on Visual Studio Code