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 at Converge 360.

comments powered by Disqus

Featured

  • Hands On: New VS Code Insiders Build Creates Web Page from Image in Seconds

    New Vision support with GitHub Copilot in the latest Visual Studio Code Insiders build takes a user-supplied mockup image and creates a web page from it in seconds, handling all the HTML and CSS.

  • Naive Bayes Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the naive Bayes regression technique, where the goal is to predict a single numeric value. Compared to other machine learning regression techniques, naive Bayes regression is usually less accurate, but is simple, easy to implement and customize, works on both large and small datasets, is highly interpretable, and doesn't require tuning any hyperparameters.

  • VS Code Copilot Previews New GPT-4o AI Code Completion Model

    The 4o upgrade includes additional training on more than 275,000 high-quality public repositories in over 30 popular programming languages, said Microsoft-owned GitHub, which created the original "AI pair programmer" years ago.

  • Microsoft's Rust Embrace Continues with Azure SDK Beta

    "Rust's strong type system and ownership model help prevent common programming errors such as null pointer dereferencing and buffer overflows, leading to more secure and stable code."

  • Xcode IDE from Microsoft Archrival Apple Gets Copilot AI

    Just after expanding the reach of its Copilot AI coding assistant to the open-source Eclipse IDE, Microsoft showcased how it's going even further, providing details about a preview version for the Xcode IDE from archrival Apple.

Subscribe on YouTube

Upcoming Training Events