Java on Visual Studio Code Update – August 2020
Welcome back to the August update of Java on Visual Studio Code. In this update, we will focus on performance improvements and project management. On to the update.
IntelliSense (a.k.a. Code Complete)
IntelliSense is one of the most frequently used VS Code features. After carefully examined current design and implementation, we were able to identify areas for improvements. In brief, the performance of IntelliSense is highly impacted by the number of requests clients send to language server and the language server’s capability to process these requests. As a result, our improvements have been focused on cutting unnecessary client requests and optimizing language server’s processing capability. Although the improvements will take a couple of iterations, we have already seen very positive results through our latest releases in August. In our test with the latest releases, we are able to achieve over 80% performance improvement. The details of our test are:
- CPU: 2.9 GHz Dual-Core Intel Core i5
- Memory: 8 GB 2133 MHz LPDDR3
- OS: macOS Catalina 10.15.6
- VS Code version: 1.48.2
- Extension tested:
|Extension||Jul. release version||Aug. release version|
|Language Support for Java(TM) by Red Hat||0.65.0||0.66.0|
|Java Test Runner||0.24.0||0.24.2|
|Project Manager for Java||0.10.2||0.13.0|
|Visual Studio IntelliCode||1.2.9||1.2.10|
In a Java file with 5000+ lines of test code, trigger IntelliSense by typing Character ‘S’, and wait till suggestion popped up. Repeat 5 times for July and August releases respectively. Each time, we measure duration between client’s request time and language server’s response time.
For our users, it’s rather common that workspace contains non-Java project related assets. For example, working on Node project, your workspace may contain “node_modules” folder; using Git, your workspace may contain “.git” folder. If run into one of these cases, you may notice the performance of refreshing workspace is negatively impacted, because these folders are being processed, which is unnecessary. To improve, we introduced a new configuration “java.project.resourceFilters”, where you can specify folders or files that should be excluded from your workspace’s refreshing. By default, ‘node_modules’ and “.git” folders are excluded. You can find the configuration by clicking Files->Preferences->Settings menu and then search for “java.project.resourceFilters” on settings view.
In July, we introduced the project view. Our goal is to allow you accessing all project management related functions through this single view. In August, we consolidated more functions into the view.
Creating packages and classes
On project view, you can create package and classes by right-clicking on a source folder. For classes, class template file will be automatically generated.
Building and cleaning workspace
Building workspace supports full build and incremental build.
Project view detects Maven project automatically. You can quickly open pom.xml file by clicking the opening icon on your project node.
Run Maven commands by right clicking the project node.
Add dependency by clicking the adding icon on Maven Dependencies node.
Last but not least, improvements have been made on debugging support, for example, added run and debug buttons onto editor title bar for single file debugging and added new configurations for JDWP. For more details, please refer to Debugger for Java.
Try it out
Please don’t hesitate to give it a try! Your feedback and suggestions are very important to us and will help shape our product in future.
- Learn more about Java on Visual Studio Code.
- Explore our step by step Java Tutorials on Visual Studio Code.