PowerShell / EditorSyntax

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

Fixes @splatting in double quoted strings #165

Closed msftrncs closed 5 years ago

msftrncs commented 5 years ago

fixes #149, fixes #164

Include of #variable was removed from #doubleQuotedString, and a alternation of @ was removed from a match in #variableNoProperty for variables that had a scope modifier.

Double quoted HereDocs do not exhibit this problem, they do not include #variable.

"No @splats.wanted here"
"No @global:splats allowed here"

I'm not noticing any side effects.

This makes no attempt to improve any other part of the variable logic (such as @splats are not allowed to have member access).

msftrncs commented 5 years ago

Forgot to mention that this could use to have some test cases as well, both in double quoted strings (sample test included in #149) and in double quoted heredocs.

msftrncs commented 5 years ago

I have added some tests for the issue this fixes, and also just-in-case for heredocs. I tested the 'tests' on the syntax prior to this PR to confirm they detect the failure for splats in double quoted strings,