Java on Visual Studio Code supports Java 18 — Visual Studio Magazine


Java on Visual Studio Code supports Java 18

The regular monthly Java update to Visual Studio Code adds support for the latest release of the language, Java 18.

The Java development team on Microsoft’s Visual Studio Code manages extensions, including the Extension pack for Java (12.4 million installs), which bundles six individual extensions that deliver the VS Code Java experience.

This experience is now centered on Java 18, the latest edition of the popular programming language that just made its debut last month. Although not as important as the Long Term Support for Java 17 (LTS) version, John K. Waters of sister publication App Development Trends explains that Java Development Kit (JDK 18) includes JDK Enhancement Proposals (JEP) for default UTF-8, simple web server, code snippets in Java API documentation, Vector API and many others.

In announcing Java 18 support for Java on VS Code as part of the April 2022 Update, Microsoft highlighted changes including:

  • Supports pop-up hints for parameter names: Developers can enable Inlay Hints to display a hint about parameter names in a method signature, with three different modes: none, literals, or all.
    Support overlay hints for parameter names in animated action
    [Click on image for larger, animated GIF view.] Support overlay hints for parameter names in animated action (source: Microsoft).
  • New Java Language Server Status UX: Previously, status bar items that displayed the current status of the Java language server could make the UX cluttered and confusing, which is addressed by finalizing new language status item APIs and doing minor tweaks so that developers will see language server elements merged into one unified element, making it more concise while providing more actions for developers to access from one place.
  • Code action to extract the Lambda body to the method: A minor feature update adds a code action (from Quick Fix) to allow developers to easily extract a lambda body to a method.
  • Support for evaluating Lambda expressions in debugging: The team fixed an issue that prevented developers from properly evaluating variables in lambda expressions when debugging.

Developers can learn more about Java in Visual Studio Code in the documentation titled “Java in Visual Studio Code.”

About the Author

David Ramel is an editor and writer for Converge360.

Briana R. Cross