News

VS Code PowerShell Tool Gets Major Feedback-Driven Overhaul

Microsoft's dev team for the PowerShell extension for Visual Studio Code has updated the tool in a major revamp some two years in the making, driven by user feedback submitted via GitHub issues.

"This update represents a complete overhaul of the core PowerShell engine of PowerShell Editor Services, intending to create a more reliable and stable user experience," said Sydney Smith, program manager, in a May 3 blog post.

As such, it features a big laundry list of highlights, from "Rewrite of PowerShell pipeline execution with cancellable and ordered tasks" to "Performance improvements with better cancellation logic."

The PowerShell extension in the VS Code Marketplace has been installed some 5.7 million times, earning an average 3.7 rating (scale 0-5) from 142 reviewers. It helps users develop PowerShell modules, commands and scripts in the wildly popular VS Code editor.

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

The new updates have been tested in the PowerShell Preview tool in the marketplace, which has been installed more than 200,000 times, earning an average 4.6 rating from five reviewers.

The aforementioned PowerShell Editor Services is the language server for the tool, leveraging the Language Server Protocol, which is used to provide programming language-specific functionality like auto complete, IntelliSense, go to definition, find all references and so on.

To fulfill goals such as improved reliability/stability, testing, feature parity with previous editions and more, the team focused on the tool's threading model.

"Previously the Integrated Console, the shell that is provided by the PowerShell extension, was run by setting threadpool tasks on a shared main runspace, and where LSP, Language Server Protocol, servicing was done with PowerShell idle events," Smith said. "This lead to overhead, threading issues and a complex implementation intended to work around the asymmetry between PowerShell as a synchronous, single-threaded runtime and a language server as an asynchronous, multi-threaded service."

Those asymmetry issues were addressed by a new dedicated pipeline thread that borrows from the JavaScript event loop so code runs synchronously on the correct thread, preventing many race conditions with more reliable and bug-free code.

"This change has overhauled how we service LSP requests, how the Integrated Console works, how PSReadLine is integrated, how debugging is implemented, how remoting is handled, and a long tail of other features in PowerShell Editor Services," Smith said.

A complete list of changes is available in the update's changelog.

Going forward, work items detailed in the associated Projects GitHub page show what's on tap.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Build Your First AI Applications with Local AI

    "AI right now feels like a vast space which can be hard to jump into," says Craig Loewen, a senior product manager at Microsoft who is helping devs unsure about making that first daunting leap.

  • On Blazor Component Reusability - From Day 0

    "We want to try to design from Day One, even Day Zero, with reusability in mind," says Blazor expert Allen Conway in imparting his expertise to an audience of hundreds in an online tech event on Tuesday.

  • Decision Tree Regression from Scratch Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of decision tree regression using the C# language. Unlike most implementations, this one does not use recursion or pointers, which makes the code easy to understand and modify.

  • Visual Studio's AI Future: Copilot .NET Upgrades and More

    At this week's Microsoft Ignite conference, the Visual Studio team showed off a future AI-powered IDE that will leverage GitHub Copilot for legacy app .NET upgrades, along with several more cutting-edge features.

  • PowerShell Gets AI-ified in 'AI Shell' Preview

    Eschewing the term "Copilot," Microsoft introduced a new AI-powered tool for PowerShell called "AI Shell," available in preview.

Subscribe on YouTube