PowerShell / EditorSyntax

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

Regex in ValidatePattern breaks highlighting #98

Closed AurimasNav closed 6 years ago

AurimasNav commented 6 years ago

Environment

Issue Description

Having round and square bracket combination within parameter validation breaks highlighting

Screenshots

expected: image

erronous: image

Code Samples

class MyClass
{
    [ValidatePattern('^(test)[a-z]')]
    [string]$Prop1
    [string]$prop2

    MyClass([string]$string)
    {
        $this.Prop1 = $string
    }
}
omniomi commented 6 years ago

Hi @AurimasNav,

This is fixed in the most recent version. The changes are live in VS Code Insiders (https://code.visualstudio.com/insiders/) as of this morning and should appear in the standard version in the next release.

If you would like to install the latest version of the syntax now without using the Insiders version of VS Code you can download the latest json file here: https://ci.appveyor.com/api/buildjobs/t6f8dy8nsrt8w3ob/artifacts/powershell.tmLanguage.json and replace the one in <vs code install dir>\resources\app\extensions\powershell\syntaxes