PowerShell / EditorSyntax

PowerShell syntax highlighting for editors (VS Code, Atom, SublimeText, TextMate, etc.) and GitHub!
MIT License
133 stars 45 forks source link

Single Quote in Param Validation for PowerShell treats everything following as string in highlighting. #33

Closed daviwil closed 6 years ago

daviwil commented 7 years ago

From @animetauren on January 30, 2017 18:0

Extension Author Version
python donjayamanne 0.5.6
PowerShell ms-vscode 0.9.0

Steps to Reproduce:

  1. Include this param in your ps1 script param block
        [parameter(Mandatory=$true, ParameterSetName="new", HelpMessage='Email Address associated with this Certificate.')][ValidatePattern('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$')]
        [String]$email,
  2. Most of the lines of the script following this line will be color highlighted as strings, even if they are not string but rather variables, functions or even commented out lines. See screenshot below:

image

Copied from original issue: Microsoft/vscode#19589

daviwil commented 7 years ago

From @aeschli on January 31, 2017 8:44

@daviwil David, FYI.

omniomi commented 6 years ago

This was resolved by #94