News

Red Hat Releases Language Support for Java Extension for VS Code

IBM subsidiary Red Hat has released a new extension for Microsoft's popular Visual Studio Code for Java source code editor. Language Support for Java by Red Hat, available on the VS Code Marketplace, has already been installed an estimated 12.4 million times and is among the top 10 most popular VS Code marketplace offerings.

Also, with this release, Java 17 is now officially supported by Red Hat's Java extensions. Earlier this month Oracle announced the general availability the JDK 17, latest update of the reference implementation of the Java SE Platform under the company’s six-month release schedule, and the second Long Term Support (LTS) since JDK 11 went GA in 2018. 

The new extension leverages the open-source Eclipse JDT Language Server to provide language-specific features and functionality when working on Java files. Since it was announced back in September 2016, the feature list for this extension has grown steadily and now includes:

  • Supports code from Java 1.5 to Java 17
  • Maven pom.xml project support
  • Basic Gradle Java project support (Android not supported)
  • Standalone Java files support
  • As-you-type reporting of parsing and compilation errors
  • Code completion
  • Code/Source actions / Refactoring
  • Javadoc hovers
  • Organize imports
    • triggered manually or on save
    • when pasting code into a java file with Ctrl+Shift+v (Cmd+Shift+v on Mac).
  • Type search
  • Code outline
  • Code folding
  • Code navigation
  • Code lens (references/implementations)
  • Highlights
  • Code formatting (on-type/selection/file)
  • Code snippets
  • Annotation processing support (automatic for Maven projects)
  • Semantic selection
  • Diagnostic tags
  • Call Hierarchy
  • Type Hierarchy

One of the most requested features in this release is type hierarchy, which allows developers to view type hierarchy in class, supertype, or subtype view. A "type hierarchy" is a system for organizing type within the design project. It establishes an order of importance and helps the design communicate its intended message more effectively.

VS Code comes bundled with other Java support wrapped in the Extension Pack for Java, which is still in preview with an estimated 9.8 million installs.

"Over the past few years, Microsoft have been working closely with Red Hat and adding new features to this language server," said Nick Zhu, senior program manager in Microsoft's Developer Division, in a statement. "We have also been fine-tuning the performance of the language server and improving the stability by addressing issues and bugs."

Red Hat has developed numerous Java extensions based on the language server, Zhu pointed out, from project management to build tools and better testing support.

"Our goal behind is to provide the best Java development experience possible on Visual Studio Code," he said.

Zhu offered a preview of upcoming features, which included:

  • Tools to make it easier to configure compiler error/warnings and code formatting options
  • More useful auto-completion suggestions (e.g., Postfix completion)
  • Ongoing adoption of convenient code actions (e.g., new Java language features) and eventually reach feature parity with those provided by the Eclipse Java IDE
  • Further improvement of the overall performance of the language server and startup time
  • Embedding a Java runtime in the extension to improve the overall "Getting Started" experience

"We believe the 1.0 release of the language support for Java by Red Hat is an important step for the overall Java journey on Visual Studio Code," he added, "and we still have a long way to go. Going forward, we plan to collaborate with Red Hat and invest in fundamental Java language support and we are committed to delivering an outstanding Java development experience."

About the Author

David Ramel is an editor and writer for Converge360.