News

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.

Java, of course, is a favorite for cloud developers on Azure and other cloud platforms, while Python is the darling language for AI, data science, machine learning and other workloads. Those latter workloads are all the rage in these days of generative AI breakthroughs, so it's no wonder that Python-related extensions in the VS Code Marketplace (Python, Pylance and Jupyter) account for the top three most popular tools, cumulatively installed a staggering 287 million times.

VS Code Python Extensions
[Click on image for larger view.] VS Code Python Extensions (source: Microsoft).

For the Python and Jupyter extensions, Microsoft highlighted the following updates:

  • Improved debug config flow for Flask and Django: "Creating launch configurations for Flask and Django apps just got easier!" Microsoft said in an April 4 announcement. "Improvements have been made to detect possible startup files in your workspace when creating a launch.json for your web app."
  • Module and import analysis on Jupyter's Run Dependent Cells with Pylance: Dependency analysis for Jupyter cells is enhanced in the latest Pylance pre-release. One key change: Pylance helps Jupyter understand module imports, which is especially useful for cells that import a module previously defined in a cell.
  • Hatch environment discovery: Default behavior now sees Hatch environments being discovered and activated like other common environments including Venv, Conda and Poetry. "In the case of Hatch where an explicit environment identifier is not registered, the extension can determine the environment type (Hatch) from the environment locator."
  • Automatic environment selection for pipenv, pyenv, and Poetry projects: The Python extension now automatically selects the corresponding environment for pipenv, pyenv or Poetry projects. Previously, the extension correctly discovered these environments but selected the default global interpreter, requiring manual selection of the appropriate environment for the workspace.
  • Report Issue command improvements: "The Python and Python Debugger extensions have adopted changes making it easier for you to report issues to our repos! Filing an issue with the Report Issue command (workbench.action.openIssueReporter) does most of the heavy lifting, prompting you for additional info so our team can efficiently triage the problem you are encountering."

Java Updates
Java enhancements, meanwhile, include: Spring Boot updates, including a preview of new refactoring capabilities for version upgrades, along with new functionality that can change log levels on the fly and add Spring Boot starters from within a pom.xml file. Also, testing coverage is now available in the stable version of Visual Studio Code.

Speaking of the new refactoring preview available for version upgrades, the dev team said: "The feature to automatically upgrade your projects to the latest Spring Boot version now allows you to choose between applying those changes directly to your project or previewing them in a refactoring preview. The refactoring preview gives you an exact diff for all the changes that the automated version upgrade process produced and allows you to select which changes to apply and which not. Please note that currently all changes are unchecked, so you need to select the changes you want to apply manually."
Upgrading to Lates Spring Boot Version
[Click on image for larger view.] Upgrading to Lates Spring Boot Version (source: Microsoft).

These new capabilities and more are available in the Extension Pack for Java, which has been installed more than 26 million times.

The extension bundle provides many different tools, including:

More information on Java in Visual Studio Code is available in the aptly named Java in Visual Studio Code documentation.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

Subscribe on YouTube