You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Evaluate $PSVersionTable in PowerShell and paste the output here
Issue Description
This should be an easy one (I hope!). I am experiencing a problem with syntax highlighting and color. The syntax coloring becomes off when I use the following line of code in my script:
Specifically, it takes issue with the backtick-dollarsign combination. If I remove the dollar sign, the coloring in all of the code below this line works again. Note the code itself works correctly, its simply the syntax color highlighting in VS Code that breaks. Here is an example of how to reproduce:
Create a new script in VS Code.
Save it as a .ps1 file.
Paste this code function snippet inside.
function Test-Function1()
{
param
(
[ValidatePattern("^([0-9A-Ha-h][0-9A-Ha-h](:|-)?){7}`$")][String[]] $Wwpn,
[string] $p1,
[string] $p2
)
Write-Host ("All of the text colors are correct, but they will be broken below.")
}
function Test-Function2()
{
param
(
[ValidatePattern("^([0-9A-Ha-h][0-9A-Ha-h](:|-)?){7}[0-9A-Ha-h][0-9A-Ha-h]`$")][String[]] $Wwpn,
[string] $p1,
[string] $p2
)
Write-Host ("The [0-9A-Ha-h][0-9A-Ha-h] sequence in function1 above breaks the code coloring. Not sure why...")
}
# Observe the oddness in code coloring. However the functions above indeed do work!
Attached Logs
Follow the instructions in the README
about capturing and sending logs.
From @Roadkill4545 on January 30, 2017 15:13
System Details
$PSVersionTable
:Name Value
PSVersion 5.0.10586.117
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.10586.117
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Evaluate $PSVersionTable in PowerShell and paste the output here
Issue Description
This should be an easy one (I hope!). I am experiencing a problem with syntax highlighting and color. The syntax coloring becomes off when I use the following line of code in my script:
Specifically, it takes issue with the backtick-dollarsign combination. If I remove the dollar sign, the coloring in all of the code below this line works again. Note the code itself works correctly, its simply the syntax color highlighting in VS Code that breaks. Here is an example of how to reproduce:
Attached Logs
Follow the instructions in the README
about capturing and sending logs.
Copied from original issue: PowerShell/vscode-powershell#472
The text was updated successfully, but these errors were encountered: