Red Hat Extension Add New Features to Java for Visual Studio Code

Red Hat has added new functionality to the Java-enabled version of Microsoft's enormously popular Visual Studio Code (VS Code) editor via its language support extension, Language Support for Java for Visual Studio Code.

Java tooling for the open source-based, cross-platform code editor is supplied by a host of extensions, all bundled in the Java Extension Pack, which now includes the new Red Hat extension. The extension was made available in March but was announced officially on April 20. According to Red Hat, which is a subsidiary of IBM, to date, the extension has been installed more times (9.7 million) than the Java Extension Pack (7.6 million).

The Red Hat extension provides capabilities "developers have been waiting for," explained Yaojin Yang, senior program manager in the Developer Division at Microsoft, in a blog post, including:

  • Type hierarchy: This adds to previous VS Code support for call hierarchy for Java. The Microsoft team worked with Red Hat to provide type hierarchy in the latest release of the latter's popular extension. It lets developers view type hierarchy in class, supertype or subtype view.
  • Package refactoring when moving file: Yaojin Yang said many developers have waiting for this feature that now comes in the Red Hat tool. It lets VS Code automatically update package declaration and import statements when a .java file is moved from one folder to another, while allowing developers to review and undo package changes.

VS Code provides such language features as code completion, refactoring, linting, formatting, and code snippets, along with debugging and unit test support. It also integrates with tooling and frameworks, such as Maven, Tomcat, Jetty, and Spring Boot. The Red Hat extension adds more functionality to the Maven for Java tool. It adds support for Maven lifecycle, which allows developers to use the Maven explorer view to directly execute common lifecycle phases with a click on a phase's "run" icon.

Finally, classpath configuration has been improved. "Managing path for source code, output, runtime, and libraries is an important project management task, almost every Java developer will perform," Yaojin Yang explained. "For those using build tool like Maven or Gradle, the tool allows managing these paths through its configuration file. However, for those not using the build tool, especially like students, they need rely on IDE/editor tool to manage. Responding to that need, we released classpath configuration feature."

Full Java on Visual Studio Code documentation provides more on using the popular programming language with the popular code editor, along with tutorials.

About the Author

David Ramel is an editor and writer for Converge360.