Skip to content
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

The snippet "Parameter: Suppress PSScriptAnalyzer Rule" is missing a closing quote and comma #4911

Open
5 of 6 tasks
JWilterdink opened this issue Feb 6, 2024 · 1 comment
Labels
Issue-Bug A bug to squash. Up for Grabs Will shepherd PRs.

Comments

@JWilterdink
Copy link

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

When using the snippet to suppress a PSScriptAnalyzer rule on a parameter, there is no closing quote or comma after the parameter name field.

Additionally, when tabbing through the snippet, the parameter name field and the justification field are both selected at the same time, though this doesn't bother me nearly as much so no objections if there's a reason it needs to stay that way.

PowerShell Version

> $PSVersionTable;$Host       

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

Name             : Visual Studio Code Host
Version          : 2024.0.0
InstanceId       : 81fc513a-022e-4fba-82ec-06feefb556d3
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-US
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

Visual Studio Code Version

> code --version
1.86.0
05047486b6df5eb8d44b2ecd70ea3bdf775fd937
x64

Extension Version

> code --list-extensions --show-versions | Select-String powershell

ms-vscode.powershell@2024.0.0

Steps to Reproduce

  1. Open a new or existing powershell file
  2. Open the command palette (e.g., ctrl+shift+P)
  3. Type "Snippets: Insert Snippet" and press enter
  4. Search for "suppress-message-rule-parameter" and press enter
  5. Snippet is inserted with missing quote and comma

Visuals

image

Logs

No response

@JWilterdink JWilterdink added Issue-Bug A bug to squash. Needs: Triage Maintainer attention needed! labels Feb 6, 2024
@andyleejordan andyleejordan added Up for Grabs Will shepherd PRs. and removed Needs: Triage Maintainer attention needed! labels Feb 6, 2024
@andyleejordan
Copy link
Member

Good catch, will happily take a PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash. Up for Grabs Will shepherd PRs.
Projects
None yet
Development

No branches or pull requests

2 participants