News

Java on VS Code Adds Gradle Tool, Simplifies Code Actions

The latest monthly update to Java on Visual Studio Code adds a Gradle extension, simplifies Code Actions execution and leverages an "important milestone," the v1.0 release of a new language server developed with Red Hat.

Java on VS Code -- the team behind the super-popular Extension Pack for Java and much more -- already announced the latter item: the Language Support for Java by Red Hat extension. Like many similar tools in the VS Code marketplace, it leverages an open source language server (in this case, Eclipse JDT Language Server) to provide language-specific features and functionality when working on Java files.

"The 1.0 release of the Language Server for Java was officially released recently!" said Nick Zhu, senior program manager, in an Oct. 29 post. "We believe this is an important milestone and result of a multi-year collaboration between Microsoft and Red Hat."

You can read all about that in the article, "Red Hat Java Tool for VS Code Released in Version 1.0."

Another new tool, which provides Grade build automation functionality for Java developers, is the aptly named Gradle for Java extension.

"You can use this interface to view Gradle Tasks and Project dependencies, or run Gradle Tasks as VS Code Task," says the item description in the Visual Studio Code Marketplace. "The extension also offers better Gradle file (e.g. build.gradle) authoring experience including syntax highlighting, error reporting and auto completion. The extension works nicely alongside other Java extensions in the Extension Pack for Java."

However, it is not yet bundled with that extension pack, Zhu said, so it may have to be downloaded separately.

"Better Gradle support has been one of the top asks in the community," he said. "This extension was originally started by @badsyntax and is now maintained by Microsoft."

He highlighted features including local Gradle installation support, a project dependency view, Gradle file authoring in Groovy, auto completion, syntax highlighting and many more.

Quicker Code Actions in Action
[Click on image for larger, animated GIF view.] Quicker Code Actions in Action (source: Microsoft).

As far as the simplified Code Actions -- used for refactorings and Quick Fixes of detected issues -- they can now be more quickly launched with the Quick Fix lightbulb icon, whereas before a coder had to right-click and select "Source Action" in order to find all the Java code actions in the menu. Supported scenarios for this functionality -- demonstrated in the animated GIF above -- include:

  • Generate Getters and Setters
  • Generate hashCode() and equals()
  • Generate toString()

Developers can learn more about Java on Visual Studio Code at Java on Visual Studio Code.

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube