News

Python AI Updates Highlight New VS Code Release

Millions of Python developers using Visual Studio Code find updated data science functionality in the new release of version 1.94, the September 2024 edition of Microsoft's open-source-based editor.

Python, by far accounting for the most popular tools in the VS Code marketplace with hundreds of millions of installs, improved in the test coverage area and Inline Chat.

The latter is the province of the GitHub Copilot AI-powered coding assistant, and the new update specifically addresses the main Python extension's Read-Eval-Print Loop (REPL). That is an interactive programming environment that takes user inputs, evaluates them, and returns the results, commonly used in scripting and interpreted languages like Python, JavaScript and Ruby. REPLs are used for exploratory programming and debugging because they let devs test code snippets quickly and see immediate results. For example, Python's native interactive shell is a REPL where devs can type Python code and see the output right away.

"The native REPL editor, used by the Python extension, now supports Copilot Inline Chat and code completions directly in the input box," said the team in announcing the update, illustrated in this video:

Python REPL (source: Microsoft).

Chat was further improved with the ability to drag and drop files to add chat context: "You can now easily attach additional files as context for a chat prompt by dragging files or editor tabs from the workbench directly into chat. For Inline Cat, hold Shift and drop a file to add it as context instead of opening it in the editor."

As far as the Python test coverage, that new feature was deemed so significant it was the subject of its own blog post in addition to being showcased in the update announcement.

"You can now run Python tests with coverage in VS Code!" said the team responsible for the Python and Jupyter extensions, together accounting for about 222 million installs. "Test coverage is a measure of how much of your code is covered by your tests, which can help you identify areas of your code that are not being fully tested."

Python Test Coverage in Animated Action
[Click on image for larger, animated GIF view.] Python Test Coverage in Animated Action (source: Microsoft).

Other Python enhancements detailed in that post include:

  • A default Python problem matcher: "Aiming to simplifying issue tracking in your Python code and offering more contextual feedback, a problem matcher scans the task's output for errors and warnings and displays them in the Problems panel, enhancing your development workflow."
  • Pylance language server mode: "There's a new setting python.analysis.languageServerMode that enables you to choose between our current IntelliSense experience or a lightweight one that is optimized for performance."

Other highlights of VS Code v1.94, meanwhile, include:

  • Find in Explorer - Quickly find files in the Explorer view with the improved Find control: "We've improved the Find feature in the Explorer view to make it easier to search for files in large projects. You can open the Find control in the File Explorer by using the Ctrl+Alt+F keyboard shortcut."
  • Source Control Graph - More filtering options and interactivity in the Source Control Graph: "we added the new Source Control Graph view. This milestone, we have been working on expanding the functionality available in the newly added view as well as polishing the layout of the view."
  • ESM - Faster VS Code startup thanks to the migration to ESM: "We are finally shipping our ESM work in VS Code Stable releases. That means that all layers of VS Code core (electron, node.js, browser, workers) use the import and export syntax in JavaScript for module loading and exporting."
  • Account preference - Specify which account to use for an extension: "In this iteration, we explored how to improve the experience of changing the preferred account for an extension. For example, if you have multiple GitHub accounts and you accidentally signed in to GitHub Copilot with the wrong account and now need to use the other one."
  • Test environment setup - Get help with setting up a test framework for your workspace: "We added an experimental /setupTests slash command that can help you configure the testing set up for your workspace. This command can recommend a testing framework, provide steps to set up and configure it, and suggest a VS Code extension to provide testing integration in VS Code."

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

Subscribe on YouTube