-
Notifications
You must be signed in to change notification settings - Fork 38.2k
Description
There's syntax highlighting as part of the PowerShell extension to indicate comments. It serves to highlight comments in green. The highlighting looks for a pattern of (?<![\\-])# to detect the start of a comment. In PowerShell, backtick is the escape character, and can be used to treat the # character as a literal character instead of the start of a comment. The regular expression that detects comments doesn't take this into account.
Code to reproduce
(($message.description | Select-Object -ExpandProperty `#cdata-section) -replace '(<\/*\w+?>){1,}','').trim()
Result of code

This line has incorrect syntax highlighting. The backtick should escape the # and negate the syntax highlighting that colors the remainder of the line green.
Possible fix
The regular expression in the PowerShell syntax tmlanguage file can be changed:
Adding the backtick character would resolve this issue, and then the pattern would be (?<![\-])#`.
Results after applying fix
I'm planning on submitting a PR to fix this after submitting this issue.
