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