News

VS Code Java Tool Updates Debugging, Refactoring

The monthly update to the tooling that boosts Java development in the open source, cross-platform Visual Studio Code editor highlights debugging, refactoring and more.

Java tooling is provided through various VS Code extensions, which can be downloaded together with the Java Pack Installer from Microsoft's Java in Visual Studio Code page.

The Java Extension Pack is available in the editor's marketplace. The package of six different extensions has been downloaded more than 4.4 million times. Still marked by a "Preview" flag, it has earned an average 4.1 (scale to 5) rating from 24 developers who reviewed it.

In announcing the May 2020 update, Yaojin Yang, senior program manager, noted some relatively minor improvements in functionality, compared to last month's update that increased performance, added support for Java 14 and more.

Debugging has been improved with the new ability to attach the debugger by process ID, which requires the latest version of the debugger extension and a configuration tweak to enable the new functionality.

Attach debugger by process ID in animated action
[Click on image for larger, animated GIF view.]Attach Debugger by Process ID in Animated Action (source: Microsoft).

Refactoring has also been improved, such that renaming a folder via the file explorer will now automatically kick off a package refactoring. Developers can then configure this to always happen automatically or choose to see a preview of changes before kicking it off manually. Or it can be turned off completely.

Another highlighted change is the display of the Java language level on the editor's status bar.

"As Java evolves, developers need deal with language level," Yang said. "Today, VS Code applies language level for your project based on project setting. As an enhancement, now VS Code's status bar displays the language level directly, so no need open your project file to look for it anymore. When you click the language level on status bar, it will take you to 'java.configuration.runtimes' setting, where you can configure your JDK settings. To get the benefit of this enhancement, you need the latest version of Language Support for Java extension and set active editor tab to a '.java' file."

Other minor tweaks include:

  • The "Create Java Project" command now allows developers to select creating a Java project with Maven support (as long as the Maven extension is installed) or a project without any build tools.
  • A new argument of "sourcePaths" supports specifying the source path as part of customer configuration for running tests. It can be found under "java.test.config" in the preference settings.
  • A new "Import Java projects in workspace" command lets developers add a module into an opened project without restarting the window.

Yang also detailed the process of bulk generating getters and setters.

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