Visual Studio Code for PowerShell 7

栏目: IT技术 · 发布时间: 4年前

内容简介:March 5th, 2020
Visual Studio Code for PowerShell 7

Sydney

March 5th, 2020

We are excited to announce that we have released a major update to the PowerShell extension for Visual Studio Code. This release contains months of architectural work that first shipped in our PowerShell Preview extension in November of 2019, along with incremental bug fixes in the intervening months. If you are new to Visual Studio Codethis article is helpful for getting started. If you already use Visual Studio Code with the PowerShell extension, read on to find out what is new.

What’s new

ISE Compatibility Module

We took the documentation from our “How to replicate the ISE experience in Visual Studio Code” doc and turned it into a switch to make the process of using Visual Studio code more familiar for Windows PowerShell ISE users.

This work can largely be seen in:

vscode-PowerShell #2335

Add editor command PowerShell: Enable/Disable ISE Mode for ISE emulation in VS Code. (Thanks @Corbob)

Syntax Highlighting, Multi-Line Editing and Back Search in the Integrated Console

PSReadLine, the module that provides the powerful command line-editing experience you are used to in the PowerShell console

(including syntax highlighting, multi-line editing and, back search), is now available in the Visual Studio Code integrated console across all operating systems. Full PSReadLine support has long been at the top of our list for feature requests.

It has also been among our most difficult problems to solve because at its core it also required architectural changes in how the PowerShell extension manages threading and runspaces. The additional challenge of trying to support both legacy versions of PowerShell and a range of platform distributions has caused this problem to continually be delayed. In January of 2019 we released a Preview version of the PowerShell extension which was built on .NET Standard thereby enabling us to support PSReadLine in the integrated console for Windows users on PowerShell Version 5.1 and above.

With PowerShell 7 delivering a fix in .NET Core 3.1 for the way POSIX terminal APIs are handled when starting new processes, we are finally able to move the PSReadLine support currently available in the PowerShell Preview extension into the stable PowerShell extension with support across platform distributions.

This work can largely be seen in:

PowerShellEditorServices #672

PSReadLine integration (Thanks @SeeminglyScience!)

Performance Improvements

Our number one user request for the PowerShell editing experience in Visual Studio Code is to improve the stability of the editor and debugger. Long-standing constraints in the original design of the PowerShell extension made it difficult to improve its robustness through incremental changes. Instead, over a period of six months we prioritized work to re-architect the extension with an emphasis on stability. Omnisharp’s architecture is more robust meaning that bugs that might once have been crashes will now be caught and logged. By leveraging this library we were able to greatly simplify our code and are now more compliant with language server protocol.

Ultimately, we believe that these changes will significantly reduce the number crashes of the extension and improve the performance overall. Other features of the Omnisharp port include asynchronous message handling for increase in performance, CodeLens requests no longer depending on running PowerShell (greatly improving Intellisense responsiveness), and formatting handled directly by the language server.

This work can be seen in:

PowerShellEditorServices #1056

Re-architect PowerShell Editor Services to use the Omnisharp LSP platform.

Other features

A number of other features have been available in the PowerShell Preview extension that are now available in the PowerShell extension.

For a full list of changes see our detailed changelog .

Breaking Changes

Support for PSReadLine in the PowerShell extension Integrated Console depends on changes made in PSReadLine 2.0, which does not support PowerShell versions 3 and 4. In turn, we also made the difficult decision to no longer support PowerShell 3 and 4 in future updates of the extension. In making this decision we analyzed the use of these PowerShell versions and found that approximately 1% of PowerShell session in VSCode use one of these versions. In order to accommodate these use cases we will shipped a final stable version of the extension with PowerShell version 3 and 4 support which can continue to be used (2020.01). To use this version of the extension the user will still install the PowerShell extension through the VSCode marketplace. They will then need to use the extension settings to select their desired version.

This breaking change can be seen in:

PowerShellEditorServices #741

Migrate to netstandard2.0 and PSStandard

We also made the decision to close over a number of APIs that were not designed for public exposure.

For more detailed information on this decision check out PowerShellEditorServices #1183 .

What’s going to happen to the Preview Extension?

Going forward we will use preview as a vNext of our stable extension, so a preview release will take bugfixes and become the next stable release. After this release we plan to continue to address other outstanding issues in the extension, and use the PowerShell Preview extension as a means of increasing our release cadence.

Feedback and Support

Once we make these releases we will continue to make investments in the PowerShell editing experience. If you encounter any issues with the PowerShell extension in Visual Studio Code or have feature requests, the best place to get support is through our GitHub repository.

Sydney Smith, Robert Holt, Tyler Leonhardt

PowerShell Team


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Java与模式

Java与模式

阎宏 编著 / 电子工业出版社 / 2002-10 / 88.00元

《Java与模式》是一本讲解设计原则以及最为常见的设计模式的实用教材,目的是为了工作繁忙的Java系统设计师提供一个快速而准确的设计原则和设计模式的辅导。全书分为55章,第一个章节讲解一个编编程模式,说明此模式的用意、结构,以及这一模式适合于什么样的情况等。每一个章节都附有多个例子和练习题,研习这些例子、完成这些练习题可以帮助读者更好地理解所讲的内容。大多数的章节都是相对独立的,读者可以从任何一章......一起来看看 《Java与模式》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码