Recently, the official Microsoft blog released the April update of Visual Studio Code Java, which includes Java 18 support, embedded hints for parameter names, new Java language server state interaction, better lambda expression support, and more.
Java18 support
The Microsoft team is constantly working to support the latest Java technologies. With the official release of Java 18 in March this year, the Microsoft team has also enabled support for Java 18 in the latest release. This means that users can now use Java 18 in their projects!
Support for embedded hints for parameter names
When writing code, have you ever wondered which parameter you are filling in? In some functions that take literals as arguments, do you want to know what value you supply?
Inlay Hints will take care of the above for you, in the latest version Microsoft Teams has enabled this feature for Java projects. When enabled, Visual Studio Code will display hints about parameter names in method signatures. There are three modes for this feature:
- None (disables parameter name hinting)
- literal (parameter name hinting is enabled for literal parameters only) (default)
- all (enable parameter name hinting for text and non-text parameters)
You can change this at any time by going to the "inlay" settings under Java
New Java language server state interaction
Previously, there were multiple items on the status bar to show the current state of the Java language server, which sometimes made the U interface crowded and cluttered. Starting with version 1.65, Visual Studio Code has completed its new language state item API. In the latest version, Microsoft Teams not only adopted the new API, but also made some small tweaks.
After the update, users will see that the various language server states have been merged into one unified item, which is not only concise, but also provides more actions for developers.
Code action to extract lambda body to function
As a minor feature update, Microsoft Teams has also added a code action to allow developers to easily extract lambda bodies into functions. E.g:
Support for lambda expressions in debugging
Previously, in an issue on GitHub, a user found that when debugging, the plugin did not evaluate the variables in the lambda expression correctly.
In the latest version, Microsoft Teams has fixed this issue. Here's a quick demonstration of evaluating variables when using lambdas in chained calls:
Original blog post:
https://devblogs.microsoft.com/java/java-on-visual-studio-code-update-april-2022/
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。