Hi everyone, welcome to the September edition of the Visual Studio Code Java update! In this post, we are going cover the new release of Gradle extension, more convenient Code Actions and recent 1.0 language server release.
Language Server for Javaโข 1.0 Release
The 1.0 release of the Language Server for Javaโข was officially released recently!ย We believe this is an important milestone and result of a multi-year collaboration between Microsoft and Red Hat. Please visit this special blog post to see the release highlights as well as future plans in detail.
Gradle for Java Extension Release
Better Gradle support has been one of the top asks in the community. To better address the Gradle needs for developers, we are excited to announce that we have now released the “Gradle for Java” extension (previously called “Gradle Tasks” extension). This extension was originally started by @badsyntax and is now maintained by Microsoft. Please note that this extension is not yet part of Extension Pack for Java and you may need to download it separately.
Let’s take a look at some highlights of this new version:
Local Gradle installation supportย ย
In previous version, Gradle wrapper in the project folder is the requirement for the extension. There was a feature request (Issue #1004) to support Gradle projects without wrapper, this feature was added to the recent release. Developers can now use the following settings to control the activation behavior.ย
- java.import.gradle.wrapper.enabledย
- java.import.gradle.versionย
- java.import.gradle.homeย
More details about these settings can be found at https://github.com/microsoft/vscode-gradle#vs-code-settings-1ย
Dependency Management and Project View
Another exciting new feature is the project dependency view. Developers can now easily view the dependencies in a project from the extension.
To view the dependencies of a project, simply click on the “Dependencies” item and all dependencies of a project is shown below. These dependencies are grouped by Gradle configurations and you can expand each configuration to see the dependencies in detail. For omitted dependency (marked with a (*)), you can click on the inline button on the right to reveal the previously listed dependency.
Gradle Authoring Experience (Groovy)
Gradle file authoring experience in Groovy is also greatly improved! There are a few new features we want to highlight:
Auto completionย
The Gradle language server supports basic auto completions for a Gradle file,ย when youโre trying to type a Gradle closuresย or properties in a Gradle script, the extension will automatically suggest available Gradleย closures for you.ย
When youโre typing a dependency in โdependenciesโ closure, the extension will automatically search in the Maven central and suggest result for you.
Syntax Highlightingย
When opening a Groovy Gradle file, the Gradle language server will start and provide language features for you.ย Basically, we offer Groovy syntax highlighting (using VS Code default style) in Gradle files. After language server starts, it will analyze theย opened Gradle file and provide semantic tokens information, providing more precise highlighting results.
Documentย outlineย
The Gradle language server will provide the document outline for the current Gradle file. This type of view will help you to navigate to any part of the Gradle file easily
Errorย reportingย
The Gradle language server will use Groovy compile engine to analyze the Gradle build file and report syntax errors if exist. It will also get scriptย classpathsย from Gradle Build so that it can report compilation errors. TheโฏGradle default importsโฏare supported.ย
There are many more features in this extension. Please visit the GitHub documentation to see the full list of features! You can follow this link to get this Gradle extension.
More Convenient Code Actionsย
We have been constantly receiving feedback that the current code actions are sometimes hard to find. Previously, developer has to right click, select “Source Action” and then find all the Java code actions in the menu.
Now, developers can simply use the lightbulb icon (Quick Fix) to generate common Java functions. Here is a list of scenarios we support
- Generate Getters and Settersย
- Generateย hashCode() and equals()ย
- Generateย toString()
Here is a quick demo:
Feedback and Suggestions
Please donโt hesitate to try our product! Your feedback and suggestions are very important to us and will help shape our product in future. There are several ways to leave us feedback
- Leave your comment on this blog post
- Open an issueย on our GitHub Issues page
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.









thanks for the helpful artcile ..
Would be great to have auto generate cunstructors too
Thanks Pascal! This is added to our issue here: https://github.com/redhat-developer/vscode-java/issues/2057
Hello,
I’m an IntelliJ user and I don’t have much experience with VSC. It’s on a good way but I think VSC is more comparable to Atom than to IntelliJ when it comes to Java
Agree that VSC and Atom is similar in terms of their code editor nature. However, we do see that more Java developers are comparing VSC to traditional Java IDEs now.