PowerShell / EditorSyntax

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

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

Open vors opened 6 years ago

vors commented 6 years ago

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

Environment

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
omniomi commented 6 years ago

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

vors commented 6 years ago

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.

msftrncs commented 6 years ago

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.