

Java on Visual Studio Code Update – April 2022
source link: https://devblogs.microsoft.com/java/java-on-visual-studio-code-update-april-2022/?WT_mc_id=academic-0000-abartolo
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Java on Visual Studio Code Update – April 2022
Nick Z
April 19th, 2022
Hi everyone, welcome to the April update of Visual Studio Code Java. This time we are bringing you many exciting updates regarding our fundamental experience improvement including Java 18 support, inlay hints for parameter names, new language server status UX, lambda expression support in debugging and so on. Let’s get into it.
Microsoft JDConf
Before we start our update, we want to share an exciting news: Microsoft JDConf is coming up! Join us for the second JDConf event on May 4 – 5, 2022. It is a virtual, Java focused conference where developers can come together to share interesting topics and stay engaged. Our goal with this event is to highlight external speakers and showcase the great work that’s going on across the Java community. You can get more information and register via this link: https://aka.ms/jdconf
Java 18 Support
We have always been targeting to support the latest Java technology. With Java 18 reaching General Availability in March this year, we have enabled the support for Java 18 in our latest version as well. This means you can now use Java 18 in your projects!
Support Inlay Hints for Parameter Names
Have you ever wondered about which parameter you are filling for in some unfamiliar methods? Don’t worry, Inlay Hints is here to help you. In our latest release, we have enabled this feature for Java projects. Once enabled, Visual Studio Code will show a hint on the parameter name in the method signature, and there are three modes of this feature.
- none (Disable parameter name hints)
- literals (Enable parameter name hints only for literal arguments) (Default)
- all (Enable parameter name hints for literal and non-literal arguments)
You can change this setting at any time by going to the “inlay” setting under Java
Here is a demo of the feature in action:
New Java Language Server Status UX
Previously, there are multiple items on the status bar to show the current state of the Java language server, this can make the UX crowded and confusing sometimes. Since version 1.65, Visual Studio Code has finalized its new Language Status Item APIs. In our latest release, we not only adopted the new API, but also made some minor adjustments. If you update to the latest version of Visual Studio Code and Extension Pack for Java, you will see the language server items have been merged into a unified item, not only making it more concise, but also providing more actions for developers to access from a single place. Here is a demo:
As you can see from the demo above, currently the language status item provides the following information and action:
Information Click Action
Build Status Detailed build information in the terminal
Build file (Whether a build configuration exists or not) Navigate to the actual Maven or Gradle build configuration file
Project JDK information Configure Java Runtime
If there is an issue or error, you will see an indicator on the status icon and you can click on “Show problems” to reveal the error details.
We hope this improvement will provide better user experience about the state of the Java language server and please share your feedback with us so we can continue to improve this area.
Code action to extract lambda body to method
As a minor feature update, we have also added a code action (from Quick Fix) to allow developers to easily extract lambda body to a method. Here is a quick demo:
Lambda expression evaluation support in debugging
Lastly, we wanted to provide an update on lambda expression support in debugging. Previously, there was an issue that prevents developer from properly evaluating variables inside lambda expressions when debugging. In our latest release, we have fixed this issue. Here is a quick demo of evaluating a variable from enclosing methods when using lambda in a chain call:
For complete list of supported case, please visit the original issue.
Feedback and suggestions
As always, your feedback and suggestions are very important to us and will help shape our product in future. There are several ways to give us feedback
- Leave your comment on this blog post
- Open an issue on our GitHub Issues page
- Send an email to: [email protected]
Resources
Here is a list of links that are helpful to learn Java on Visual Studio Code.
- Learn more about Java on Visual Studio Code.
Nick Zhu Senior Program Manager, Developer Division at Microsoft
Follow
Recommend
-
106
See what is new in the Visual Studio Code April 2018 Release (1.23)
-
8
We are excited to announce that an update to our PowerShell extension is now available on the Visual Studio Code Marketplace. This blog will...
-
7
-
10
We are excited to announce that an update to our PowerShell extension is now available on the Visual Studio Code Marketplace. This blog will explain...
-
15
Visual Studio Code C++ December 2021 Update: clang-tidy Julia December 14th, 2021 The latest
-
3
Visual Studio Code + Java Feb 2022 updates Visual Studio Code + Java Feb 2022 updates ...
-
10
Major update to the PowerShell Extension for Visual Studio Code Sydney S May 3rd, 2022
-
8
PowerShell Extension for Visual Studio Code June 2022 Update Sydney...
-
7
Java on Visual Studio Code Update – July 2022 Nick Zhu...
-
6
April 2024 (version 1.89) Downloads: Windows: x64
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK