{"id":19594,"date":"2022-07-01T06:28:27","date_gmt":"2022-07-01T14:28:27","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/powershell\/?p=19594"},"modified":"2022-08-01T09:19:40","modified_gmt":"2022-08-01T17:19:40","slug":"powershell-extension-for-visual-studio-code-june-2022-update","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/powershell-extension-for-visual-studio-code-june-2022-update\/","title":{"rendered":"PowerShell Extension for Visual Studio Code June 2022 Update"},"content":{"rendered":"<p>We are excited to announce that an update to the\u00a0<a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-vscode.PowerShell\" rel=\"nofollow\">PowerShell Extension for Visual Studio Code <\/a>is now available on the extension marketplace.<\/p>\n<p dir=\"auto\">This release fixes a number of issues related to IntelliSense and enables updates to PowerShell Editor Services (the engine of the VS Code extension) for other clients, such as Emacs and Vim with LSP plug-ins.<\/p>\n<h3>Updates from the June releases<\/h3>\n<p dir=\"auto\">Some highlights of June releases:<\/p>\n<ul>\n<li>\n<p>Fix how we check extension mode.\u00a0<a href=\"https:\/\/github.com\/PowerShell\/vscode-powershell\/pull\/3992\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"\/PowerShell\/vscode-powershell\/pull\/3992\/hovercard\">vscode-powershell #3992<\/a><\/p>\n<\/li>\n<li>\n<p>Add warning about IntelliSense to PowerShell Integrated Console terminate dialog. (Thanks @JustinGrote!)\u00a0<a href=\"https:\/\/github.com\/PowerShell\/vscode-powershell\/pull\/3976\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"\/PowerShell\/vscode-powershell\/pull\/3976\/hovercard\">vscode-powershell #3976<\/a><\/p>\n<\/li>\n<li>\n<p dir=\"auto\">Add regression test for no defined profiles.\u00a0<a href=\"https:\/\/github.com\/PowerShell\/PowerShellEditorServices\/pull\/1821\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"\/PowerShell\/PowerShellEditorServices\/pull\/1821\/hovercard\">PowerShellEditorServices #1821<\/a><\/p>\n<\/li>\n<li>\n<p dir=\"auto\">Add Emacs regression tests for PowerShellEditorServices.\u00a0<a href=\"https:\/\/github.com\/PowerShell\/PowerShellEditorServices\/pull\/1820\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"\/PowerShell\/PowerShellEditorServices\/pull\/1820\/hovercard\">PowerShellEditorServices #1820<\/a><\/p>\n<\/li>\n<li>\n<p dir=\"auto\">Set\u00a0<code>IsDebuggingRemoteRunspace<\/code>\u00a0sooner for attach.\u00a0<a href=\"https:\/\/github.com\/PowerShell\/PowerShellEditorServices\/pull\/1815\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"\/PowerShell\/PowerShellEditorServices\/pull\/1815\/hovercard\">PowerShellEditorServices #1815<\/a><\/p>\n<\/li>\n<li>\n<p dir=\"auto\">Fix error when piping\u00a0<code>IFilePosition<\/code>\u00a0to\u00a0<code>ConvertTo-ScriptExtent<\/code>.\u00a0<a href=\"https:\/\/github.com\/PowerShell\/PowerShellEditorServices\/pull\/1814\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"\/PowerShell\/PowerShellEditorServices\/pull\/1814\/hovercard\">PowerShellEditorServices #1814<\/a><\/p>\n<\/li>\n<li>\n<p dir=\"auto\">Additional IntelliSense fixes and ToolTip overhaul.\u00a0<a href=\"https:\/\/github.com\/PowerShell\/PowerShellEditorServices\/pull\/1809\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"\/PowerShell\/PowerShellEditorServices\/pull\/1809\/hovercard\">PowerShellEditorServices #1809<\/a><\/p>\n<\/li>\n<li>\n<p dir=\"auto\">Fix startup bug when zero profiles are present.\u00a0<a href=\"https:\/\/github.com\/PowerShell\/PowerShellEditorServices\/pull\/1807\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"\/PowerShell\/PowerShellEditorServices\/pull\/1807\/hovercard\">PowerShellEditorServices #1807<\/a><\/p>\n<\/li>\n<li>\n<p dir=\"auto\">Fix execution of debug prompt commands.\u00a0<a href=\"https:\/\/github.com\/PowerShell\/PowerShellEditorServices\/pull\/1803\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"\/PowerShell\/PowerShellEditorServices\/pull\/1803\/hovercard\">vscode-powershell #3980<\/a><\/p>\n<\/li>\n<li>\n<p dir=\"auto\">Re-enable stdio clients by fixing initialization sequence.\u00a0<a href=\"https:\/\/github.com\/PowerShell\/PowerShellEditorServices\/pull\/1801\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"\/PowerShell\/PowerShellEditorServices\/pull\/1801\/hovercard\">PowerShellEditorServices #1695<\/a><\/p>\n<\/li>\n<li>\n<p dir=\"auto\">Fix a lot of IntelliSense issues.\u00a0<a href=\"https:\/\/github.com\/PowerShell\/PowerShellEditorServices\/pull\/1799\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"\/PowerShell\/PowerShellEditorServices\/pull\/1799\/hovercard\">PowerShellEditorServices #1799<\/a><\/p>\n<\/li>\n<li>\n<p dir=\"auto\">Increase stack size for PowerShell 5. (Thanks @nohwnd!)\u00a0<a href=\"https:\/\/github.com\/PowerShell\/PowerShellEditorServices\/pull\/1797\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"\/PowerShell\/PowerShellEditorServices\/pull\/1797\/hovercard\">vscode-powershell #3962<\/a><\/p>\n<\/li>\n<\/ul>\n<p dir=\"auto\">For the full list of changes please refer to our\u00a0<a href=\"https:\/\/github.com\/PowerShell\/vscode-powershell\/edit\/main\/CHANGELOG.md\">changelog<\/a>.<\/p>\n<h3 dir=\"auto\">IntelliSense improvements<\/h3>\n<p dir=\"auto\">In this release we have made a number of improvements to IntelliSense (the general term for various code editing features including: code completion, parameter info, tool-tip hovers, etc.).<\/p>\n<h4>Mark completion request handler as serial<\/h4>\n<p dir=\"auto\">Previously, if you typed\u00a0<code>Get-<\/code>\u00a0very quickly, you&#8217;d get no results at all. This stops completion from being cancelled whenever a\u00a0<code>DidChangeTextDocument<\/code>\u00a0notification is sent. This also lets completion cancel some other expensive requests like code lenses, which means everything is both speedier and less flaky.<\/p>\n<h4>Fix tasks never completing if cancelled quickly<\/h4>\n<p dir=\"auto\">We were exiting\u00a0<code>SynchronousTask.ExecuteSynchronously<\/code>\u00a0early if the cancellation was already requested. This was not setting our state correctly, causing the caller to just fall off without warning. This made some things like\u00a0<code>finally<\/code>\u00a0and\u00a0<code>using<\/code>\u00a0disposals never happen, which led to a lot of erratic behavior!<\/p>\n<h4>Make alias discovery possible on idle<\/h4>\n<p dir=\"auto\">The use of\u00a0<code>Runspace.SessionStateProxy<\/code>\u00a0while the pipeline thread is busy (even if you are on the pipeline thread) results in an exception. By fixing this we can also cancel\u00a0<code>GetAliasesAsync<\/code>\u00a0(a slow operation) when needed, and do it while idling instead of startup.<\/p>\n<h4>Add &#8220;space&#8221; character to completion trigger characters<\/h4>\n<p dir=\"auto\">Adding the &#8220;space&#8221; character to completion triggers lets us automatically give completion results for parameter values. This also required building in some support for marking completion results as &#8220;incomplete&#8221;. This means that the client will not cache results when standard identifier characters are typed.<\/p>\n<p dir=\"auto\">Mainly, this solves the scenario where you type\u00a0<code>space<\/code>, get file completion results, and then type\u00a0<code>-<\/code>. You expect to then get parameter names, but without marking &#8220;incomplete&#8221;, it will instead filter the file results.<\/p>\n<p dir=\"auto\">Also fixed a scenario where you type\u00a0<code>$script:<\/code>\u00a0and on typing the\u00a0<code>:<\/code>\u00a0it would not update to available script scope variables.<\/p>\n<h4>Make completion requests cancellable<\/h4>\n<p dir=\"auto\">Now any completion results from custom argument completers can be cancelled if they take too long and the user keeps typing. In non-remote runspaces, we can also use it as a completion source that we can cancel by way of issuing a pipeline stop request.<\/p>\n<h3>What&#8217;s next for the project?<\/h3>\n<p dir=\"auto\">We are currently building out regression tests for the extension to cover everything we broke and subsequently fixed during the major rewrite earlier this year. We have a strong focus on quality, and want to ensure we continue to deliver a production-ready, high-quality extension to you, our users. We have made a large investment in improving the extension so we want to be able to confidently continue to iterate on this project without inadvertently impacting the performance, stability, or feature set. We&#8217;ve begun this work already, and are tracking in our\u00a0<a href=\"https:\/\/github.com\/PowerShell\/PowerShellEditorServices\/issues\/1733\" data-hovercard-type=\"issue\" data-hovercard-url=\"\/PowerShell\/PowerShellEditorServices\/issues\/1733\/hovercard\">GitHub repository<\/a>.<\/p>\n<h3>Getting support and giving feedback<\/h3>\n<p dir=\"auto\">While we hope the new implementation provides a much better user experience, there are bound to be issues. Please let us know if you run into anything.<\/p>\n<p dir=\"auto\">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\u00a0<a href=\"https:\/\/github.com\/PowerShell\/vscode-powershell\/issues\/new\/choose\">GitHub repository<\/a>.<\/p>\n<p dir=\"auto\">Sydney<\/p>\n<p dir=\"auto\">PowerShell Team<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are excited to announce that an update to the\u00a0PowerShell Extension for Visual Studio Code is now available on the extension marketplace. This release fixes a number of issues related to IntelliSense and enables updates to PowerShell Editor Services (the engine of the VS Code extension) for other clients, such as Emacs and Vim with [&hellip;]<\/p>\n","protected":false},"author":2299,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[3175],"class_list":["post-19594","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell","tag-visual-studio-code"],"acf":[],"blog_post_summary":"<p>We are excited to announce that an update to the\u00a0PowerShell Extension for Visual Studio Code is now available on the extension marketplace. This release fixes a number of issues related to IntelliSense and enables updates to PowerShell Editor Services (the engine of the VS Code extension) for other clients, such as Emacs and Vim with [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/19594","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/2299"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=19594"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/19594\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=19594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=19594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=19594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}