PowerShell / EditorSyntax

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

foreach not scoped correctly after curly brace #199

Open alexr00 opened 4 years ago

alexr00 commented 4 years ago

From @scriptingstudio in https://github.com/microsoft/vscode/issues/97404

Environment

Issue Description

Powershell methods foreach and where are not highlighted after curly bracket. With parenthesis it works fine.

Example code:

@($group).where{$_.count -gt 1 -and $_.name}.foreach{...}

"where" is highlighted. "foreach" is not highlighted and has a very general scope

Screenshots

image

Expected Behavior

The foreach should have a more specific scope.

Code Samples

@($group).where{$_.count -gt 1 -and $_.name}.foreach{...}