VS Code is getting better and better for Java. Over the past two months, we have made progress in all key areas, including core language support, testing, debugging, refactoring, and project management. Let’s discover new hidden and less hidden gems!

You have a type hierarchy

VS Code already supports Java call hierarchies, but what about type hierarchies?

We are very pleased to work with Red Hat to announce the disclosure of type hierarchies in the latest release of Java language support for Red Hat.

This feature allows you to view type hierarchies in class, supertype, or subtype views:

Automatic test generation

Automatically generating test method templates and importing test packages is a convenient feature to improve coding efficiency.

Starting in April, you can generate method templates directly from test files. In May, we will also add support for generation from source files. To generate a test method template, open or create a test file in the project’s tests folder, right click on the file editor to invoke the context menu, and select “Source Action…” “And then” Generate Test…” , and finally select the method to generate:

Software package refactoring when moving files

VS Code can automatically update package declarations and import statements when moving.java files from one folder to another.

The latest version of Java language support released by Red Hat now supports this feature. In addition to automatic updates, this feature allows you to view and undo package changes:

Classpath configuration

Managing source code, output, runtime, and library paths is an important project management task that almost every Java developer performs. For people using a build tool such as Maven or Gradle, the tool allows you to manage these paths through their configuration files.

However, for those who don’t use build tools, especially those like students, they rely on IDE/editor tools for management. To meet this requirement, we have released the classpath configuration feature. You can launch the classpath configuration from the JAVA PROJECTS Explorer, or you can click Ctrl + Shift + P to open the command palette, and then type configure Classpath on the palette.

Debugging enhanced

Inline value

The Java Extension debugger can now display variable values inline in the editor as you step through the source code:

You can enable this feature by going to File -> Preferences -> Settings Menu, searching for “debug.inlineValues” in Settings view, and then selecting options.

Custom variable view

You can right-click the view to bring up custom menus.

VS Code 1.56 Release Party demonstrates debugging enhancements.

Maven enhancement

Life cycle support

You can now execute common lifecycle phases directly from the Maven Explorer view by clicking the run icon next to the phases:

Sound experience in creating projects

Until next time, have fun coding!

www.jdon.com/56357