PowerShell / EditorSyntax

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

Update syntax for && and || statement operators #187

Open rjmholt opened 4 years ago

rjmholt commented 4 years ago

Issue Description

PS 7 adds the && and || pipeline chain operators. These will need implementing in the TM grammar.

Expected Behavior

Highlight && and || like & or ;, highlight pipelines between them as normal

Code Samples

Get-Command -Name 'mycommand' && & mycommand
msftrncs commented 4 years ago

I thought they were already in the syntax, but I cannot find them at this time.

In #155 and #156, I have them in as 'invalid.reserved'.

rjmholt commented 4 years ago

In #155 and #156, I have them in as 'invalid.reserved'.

That's really useful, thanks!

msftrncs commented 4 years ago

@rjmholt, can you link to a PR in PowerShell/PowerShell where this is being added?

Thanks

msftrncs commented 4 years ago

I knew I had seen them in this repo, here they are:

https://github.com/PowerShell/EditorSyntax/blob/d10ae29c0d3ceb248172c383a159ae43b9ccfb4d/PowerShellSyntax.tmLanguage#L365-L370

rjmholt commented 4 years ago

https://github.com/PowerShell/PowerShell-RFC/pull/192