EditorSyntax icon indicating copy to clipboard operation
EditorSyntax copied to clipboard

Highlighting for strings with "$(...)" is inconsistent

Open vors opened this issue 6 years ago • 3 comments

Moved from https://github.com/SublimeText/PowerShell/issues/66

Environment

  • Editor and Version (VS Code, Atom, Sublime): Sublime
  • Your primary theme: Default

Issue Description

$(...) inside a string is an expression interpolation. Ideally it should be highlighted exectly the same way as it's highlighted when put outside of the string context. I'm not sure it's possible to achive with regex grammar.

Screenshots

Sublime -- difference between interpolated and non-interpolated image

Expected Behavior

PowerShell_ISE -- both are the same image

Code Samples

"blablabla $(invoke-foo baz $a.bar) blablabla"
invoke-foo baz $a.bar

vors avatar May 26 '18 21:05 vors

This would be easier with .sublime-syntax but I'll see what we can do within .tmLanguage.

omniomi avatar May 26 '18 21:05 omniomi

Yeah, sublime-syntax is more powerful then tmLanguage, but the benefits of having a common EditorSyntax (that we finally got) outweigh the benefits of more expressive grammar rules.

vors avatar May 26 '18 21:05 vors

also see the images in this issue:

https://github.com/PowerShell/vscode-powershell/issues/1401

It shows the static methods referenced in the first couple lines are colored wrong. Didn't realize it right away, as everything else looks pretty consistent.

msftrncs avatar Jul 11 '18 03:07 msftrncs