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

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube