头图

Hi everyone, and welcome to the September Update for Visual Studio Code Java. This time we have tons of exciting new features and improvements in many areas like project import, Spring support, remote debugging and unit testing, so let's get started!


Protobuf (Protocol Buffer) project support

Protocol Buffers ( Protobuf ) is a free, open-source, cross-platform data format for serializing structured data. Previously, our Java plugin wouldn't work well if a Java project involved protobufs, and you might run into tons of unrecognized classes. This is because our plugin cannot detect the proto file correctly, so the required code is not generated and the generated code cannot be found.

In our latest release, we have added support for the "protobuf" project. If a " .protobuf " file is detected, you will see a prompt from Visual Studio Code asking if you want to generate Java source code from the proto file. When you click "Yes", our plugin will generate the code and all "unrecognized type" errors will go away! Here is a quick demo to demonstrate this functionality.

image.png

Improvements to Android project import

In addition to protobuf projects, we have also improved support for Android projects. Previously, imports of Android projects would fail silently, and most core Java functionality would not work. However, we've recently fixed this issue and you can now import Android projects with confidence. Once imported, all Java language features can be used as normal. Here is a quick demo.

image.png

To use this feature, you need to configure java.jdt.ls.androidSupport.enabled . Here is a screenshot of this setup:

image.png

Spring feature enhancements

▌Spring Boot Actuator integration in Spring Boot Dashboard

Starting this year, we've added a lot of functionality to the Spring Dashboard plugin to bring a better visualization experience to Spring developers. A common feature in Dashboard is to display runtime information for a running Spring project. However, to enable this feature, the project needs to have Spring Boot Actuator enabled.

In order to provide a smoother experience for developers, we have added the ability to automatically detect Spring Boot Actuator dependencies in the Spring project. If it's not detected, we'll display a prompt letting you know that Spring Boot Actuator is required for runtime information, or even add it directly for you. If you choose not to add it, only static information will be displayed. Here is a quick demo.

image.png

▌Spring Boot project creation experience optimization

There are also improvements to the Spring Boot project creation experience. During this process, we added external links to Spring documentation and code samples. If you see a book icon, you can click the icon and browse the related documentation for more information on project components.

image.png

Greatly improved remote debugging performance under high network latency

Good news for cloud-native developers: Our remote debugging performance has improved significantly when network latency is high. In some cases, latency can be reduced by a factor of 2 to 45 . Interested developers can find detailed information, including technical background and solutions, in this GitHub issue . We will also write a fuller blog to discuss this improvement. Please note that this feature is still a preview feature, so it is enabled in the Insider version by default. If you want to experience it in the Stable version, please set java.debug.settings.jdwp.async to true. Here's a demo to show the experience.

image.png

Tests – Filter tests with JUnit 5 Tag

Finally, we added a feature to improve unit testing. In our latest release, we've added support for JUnit 5 Tags, so you can filter out certain tests during the execution phase. The way to use this feature is to configure it in settings.json . For more information on configuring it, see this tutorial . Below is a quick demo.

image.png

Install the Java plugin package

To use all the features above, download and install the Extension Pack for Java on Visual Studio Code.

image.png

feedback and suggestions

There will be many exciting updates to Java on Visual Studio Code in 2022, and as always, your feedback and suggestions are very important to us and will help shape our future products. There are several ways to leave us feedback

resource

The following links and resources can help you better understand Java on Visual Studio Code


Click here to go to the original blog~


微软技术栈
423 声望995 粉丝

微软技术生态官方平台。予力众生,成就不凡!微软致力于用技术改变世界,助力企业实现数字化转型。