EditorSyntax icon indicating copy to clipboard operation
EditorSyntax copied to clipboard

Variables that are built-in constants are not highlighted, like `$Error` and `$PSVersionTable`

Open o-l-a-v opened this issue 1 year ago • 0 comments
trafficstars

Prerequisites

  • [X] Write a descriptive title.
  • [X] Make sure you are able to repro it on the latest version
  • [X] Search the existing issues.

Steps to reproduce

Noticed that both VSCode and GitHub doesn't highlight some variables, like $Error and $PSVersionTable

This:

```powershell
#Requires -Version 5.1
$SomeVariable
$Error
$PSVersionTable
string without quotes
'string with quotes'
```

Looks like this on GitHub:

#Requires -Version 5.1
$SomeVariable
$Error
$PSVersionTable
string without quotes
'string with quotes'
image

And in VSCode:

image

Expected behavior

Highlight.js demo https://highlightjs.org/demo does as I expect it to:

image

PowerShell ISE and the PowerShell terminal too:

image

Actual behavior

Steps to reproduce

Error details

No response

Environment data

PowerShell 7.4.1 x64 on Windows 11 23H2
VSCode 1.87.2, vscode-powershell v2024.0.0 and v2024.3.1-preview

Version

Latest?

Visuals

No response

o-l-a-v avatar Mar 17 '24 12:03 o-l-a-v