News

Microsoft's PowerShell Dev Team Helps Fix OmniSharp

In announcing an update to the PowerShell extension for Visual Studio Code, Microsoft's dev team revealed it helped fix the latest edition of the OmniSharp C# Language Server Protocol in a month-long effort. One of the bugs fixed would have broken the debugger, while the other affected startup reliability.

The LSP defines how a language server works with an IDE/editor, effectively providing language-specific "smarts" like auto complete, go to definition, find all references and so on.

The C# Language Server Protocol is an open source project that's just one tool in the arsenal of OmniSharp, described as a family of projects designed to enable a great .NET experience in various editors/IDEs.

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

The VS Code PowerShell extension uses the OmniSharp LSP library and Debug Adapter Protocol (DAP) server library, said to be the tool's biggest dependency. It helps users develop PowerShell modules, commands and scripts in VS Code. In a new update of the PowerShell extension, the team used the latest update to OmniSharp, v0.19.2. In doing so, the team found the bugs, which it helped fix.

"After our initial upgrade to OmniSharp v0.19.0, as early adopters we encountered two major bugs in the library," revealed a June 2 blog post announcing the May 2021 update to the extension. "Rob [Holt] and Andy [Schwartzmeyer] spent a month identifying and solving a serialization bug in the Debug Adapter Protocol which would have broken the extension's debugger, and a race condition which temporarily impacted startup reliability in the preview extension. As our fixes went upstream, we improved the OmniSharp library not only for the PowerShell extension, but also for several other Visual Studio Code extensions similarly relying on OmniSharp."

Other highlights of the May 2021 update to the PowerShell extension detailed in the announcement include:

The extension in the VS Code Marketplace has been installed more than 4 million times, earning and average 3.8 rating (scale to 5) from 124 developers who reviewed it. It provides:

  • Syntax highlighting
  • Code snippets
  • IntelliSense for cmdlets and more
  • Rule-based analysis provided by PowerShell Script Analyzer
  • Go to Definition of cmdlets and variables
  • Find References of cmdlets and variables
  • Document and workspace symbol discovery
  • Run selected selection of PowerShell code using F8
  • Launch online help for the symbol under the cursor using Ctrl+F1
  • Local script debugging
  • Integrated console support
  • PowerShell ISE color theme

The tool's development is carried out on GitHub.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Uno Platform Wants Microsoft to Improve .NET WebAssembly in Two Ways

    Uno Platform, a third-party dev tooling specialist that caters to .NET developers, published a report on the state of WebAssembly, addressing some shortcomings in the .NET implementation it would like to see Microsoft address.

  • Random Neighborhoods Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the random neighborhoods regression technique, where the goal is to predict a single numeric value. Compared to other ML regression techniques, advantages are that it can handle both large and small datasets, and the results are highly interpretable.

  • As Some Orgs Restrict DeepSeek AI Usage, Microsoft Offers Models and Dev Guidance

    While some organizations are restricting employee usage of the new open source DeepSeek AI from a Chinese company due to data collection concerns, Microsoft has taken a different approach.

  • Useful New-ish Features in .NET/C#

    We often hear about the big new features in .NET or C#, but what about all of those lesser known, but useful new features? How exactly do you use constructs like collection indices and ranges, date features, and pattern matching?

  • TypeScript 5.8 Beta Speeds Program Loads, Updates

    "TypeScript 5.8 introduces a number of optimizations that can both improve the time to build up a program, and also to update a program based on a file change in either --watch mode or editor scenarios."

Subscribe on YouTube