EditorSyntax icon indicating copy to clipboard operation
EditorSyntax copied to clipboard

foreach not scoped correctly after curly brace

Open alexr00 opened this issue 5 years ago • 0 comments
trafficstars

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

Environment

  • Editor and Version (VS Code, Atom, Sublime): VS Code Version: 1.46.0-insider (user setup) also happens on 1.45 Commit: 288852d8c26d797974bfb8aed06e1bff9b809223 Date: 2020-05-12T05:43:31.363Z Electron: 7.2.4 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Windows_NT x64 10.0.19041
  • Your primary theme: N/A

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{...}

alexr00 avatar May 12 '20 08:05 alexr00