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

  • 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