vscode-powershell icon indicating copy to clipboard operation
vscode-powershell copied to clipboard

do-while shortcut gives too many parentheses

Open ncook-hxgn opened this issue 3 years ago • 1 comments

Prerequisites

  • [X] I have written a descriptive issue title.
  • [X] I have searched all open and closed issues to ensure it has not already been reported.
  • [X] I have read the troubleshooting guide.
  • [X] I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • [X] I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • [X] If this is a security issue, I have read the security issue reporting guidance.

Summary

Open VS Code and create a new PowerShell script. In the new PowerShell script, write do- and select the do-while snippet. Yields this buggy code: image

Doesn't happen with do-until snippet.

Plz fix

PowerShell Version

Name                           Value
----                           -----
PSVersion                      5.1.19041.1682
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1682
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Visual Studio Code Version

1.70.0
da76f93349a72022ca4670c1b84860304616aaa2
x64

Extension Version

[email protected]

Steps to Reproduce

Open VS Code and create a new PowerShell script. In the new PowerShell script, write do- and select the do-while snippet.

Visuals

image

Logs

No response

ncook-hxgn avatar Aug 09 '22 14:08 ncook-hxgn

That snippet is right here:

https://github.com/PowerShell/vscode-powershell/blob/2d3a3c26fa9b5e54bdc4087b64f9729df30d01d0/snippets/PowerShell.json#L90-L100

If you want to fix it and submit a PR, I'd be more than happy to merge it!

andyleejordan avatar Aug 09 '22 15:08 andyleejordan

Resolved, thanks! New preview will be out soon.

andyleejordan avatar Aug 10 '22 17:08 andyleejordan