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


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

查看所有标签

猜你喜欢:

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

做自己:鬼脚七自媒体第一季

做自己:鬼脚七自媒体第一季

鬼脚七 / 电子工业出版社 / 2013-7 / 77.00元

当我们习惯了在社会上带着面具的时候,真实成为了一件奢侈的事情。 做到足够真实,让自己的本性表达出来,这需要勇敢。本书是鬼脚七自媒体的原创文集,主题就是做自己。本书有关于生活、互联网、自媒体的睿智分享,也有关于淘宝、搜索的独到见解,是一本接地气,文艺范,并充满正能量的电商生活书。 本书最适合淘宝卖家、电子商务人群、希望了解电商和互联网的人群阅读,也推荐热爱生活的70、80、90后阅读。一起来看看 《做自己:鬼脚七自媒体第一季》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具