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 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