Skip to content

do-while shortcut gives too many parentheses #4119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
6 tasks done
ncook-hxgn opened this issue Aug 9, 2022 · 2 comments · Fixed by #4120
Closed
6 tasks done

do-while shortcut gives too many parentheses #4119

ncook-hxgn opened this issue Aug 9, 2022 · 2 comments · Fixed by #4120
Labels
Area-Snippets Issue-Bug A bug to squash. Resolution-Fixed Will close automatically. Up for Grabs Will shepherd PRs.

Comments

@ncook-hxgn
Copy link
Contributor

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • 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

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 ncook-hxgn added the Issue-Bug A bug to squash. label Aug 9, 2022
@ghost ghost added the Needs: Triage Maintainer attention needed! label Aug 9, 2022
@andyleejordan andyleejordan added the Up for Grabs Will shepherd PRs. label Aug 9, 2022
@andyleejordan
Copy link
Member

That snippet is right here:

"do-while": {
"prefix": "do-while",
"description": "Runs a statement list repeatedly as long as a condition is met. More: Get-Help about_Do",
"body": [
"do {",
"\t${0:$TM_SELECTED_TEXT}",
"} while (",
"\t${1:<# Condition that stops the loop if it returns false #>})",
")"
]
},

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

ncook-hxgn added a commit to ncook-hxgn/vscode-powershell that referenced this issue Aug 9, 2022
Removes extraneous `)` from the do-while powershell snippet
@andyleejordan andyleejordan added Area-Snippets and removed Needs: Triage Maintainer attention needed! labels Aug 9, 2022
@andyleejordan andyleejordan linked a pull request Aug 10, 2022 that will close this issue
1 task
@andyleejordan
Copy link
Member

Resolved, thanks! New preview will be out soon.

@andyleejordan andyleejordan added the Resolution-Fixed Will close automatically. label Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Snippets Issue-Bug A bug to squash. Resolution-Fixed Will close automatically. Up for Grabs Will shepherd PRs.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants