EditorSyntax icon indicating copy to clipboard operation
EditorSyntax copied to clipboard

Update syntax for && and || statement operators

Open rjmholt opened this issue 6 years ago • 5 comments
trafficstars

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

rjmholt avatar Oct 15 '19 17:10 rjmholt

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'.

msftrncs avatar Oct 15 '19 19:10 msftrncs

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

That's really useful, thanks!

rjmholt avatar Oct 15 '19 20:10 rjmholt

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

Thanks

msftrncs avatar Oct 16 '19 02:10 msftrncs

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

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

msftrncs avatar Oct 16 '19 02:10 msftrncs

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

rjmholt avatar Oct 18 '19 23:10 rjmholt