Java on VS Code April update includes Java 14 support
The monthly update for Java on Visual Studio Code has arrived from Microsoft. The April 2020 update includes support for Java 14, new performance upgrades, previews for proposed upcoming changes, and much more. See what’s new.
Every month, Microsoft releases a new update for Java on Visual Studio Code. The latest update arrived on April 30, 2020, and was announced by Xiaokai He, Senior Program Manager for Java on Visual Studio Code and Azure.
Java on VS Code is supported by various extensions that increase the capabilities of Visual Studio Code. It helps the editor support Java coding, testing, and debugging. The Java Extension Pack consists of a number of popular extensions used by Java developers, including Language Support for Java by Red Hat, a debugger, Java Runner, Maven for Java, and more.
Let’s see what’s in store with the latest update.
Support for Java 14
Time for an update. Java 14 is now officially supported by Java on VS Code.
In order to use some of the Java 14 preview features, you may have to modify your project settings in Maven and Gradle. (Furthermore, you may need to clean the Java language server workspace and reload.)
VS Code version 1.43 added Semantic Highlighting as a feature for all themes.
Semantic highlighting enriches the syntax coloring based on symbol information from a language service that has the full understanding of the project. Based on this understanding each identifier gets colored & styled with the color of the symbol it resolves to. A constant variable name is rendered as constant throughout the file, not just in its declaration. Same for parameter names, property names, class names and so on.
View the below image for an example. The left side shows Semantic Highlighting enabled; the right only uses syntax highlighting.
Upon startup, you can either disable or enable it, or toggle the `java.semanticHighlighting.enabled` preference.
The latest update enables syntax server for all projects.
The following image from Xiaokai He’s blog post shows how quickly the changes improve performance upon startup.
Xiaokai He writes:
The idea is since building and indexing the project takes a long time, it’s annoying for our developers to wait. With the help of syntax server, instead of waiting for all the dependencies to be downloaded, you can use the features listed below right away:
- Syntax Highlighting & Syntax Errors
- Code Navigation (Go to Definition, etc.)
- Documentation (Hover to See Javadoc)
- Code Structures (Outline, Folding Range, etc.)
Once the full language server is ready, the syntax server would be turned off automatically.
Additional changes this month include new documentation added to the official site, improved Gradle support, and improved organize import.
The April update adds a new way to create a class from the file explorer. When you create a .java file in the File Explorer, it will now auto-generate the class body and fill in package information. Java on VS Code also adds a preview for rename refactoring from file explorer.
A new extension from Red Hat arrives. Community Server Connectors helps connect VS Code with open source community-driven servers and runtimes. It provides better support for Apache Felix, Karaf, and Tomcat.
Read the blog post by Xiaokai He for a rundown of all the newest changes.