Skip to content

Some variables are not highlighted ($Error, $PSVersionTable) #4944

@o-l-a-v

Description

@o-l-a-v

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

Some variables are not highlighted. I've tried on Windows and Linux, with vscode-powershell stable v2024.0.0 and preview v2024.3.1.

Expected behavior: All variables should be highlighted, like so:

$SomeVariable
$Error
$PSVersionTable

Edit: GitHub syntax highlighting does it too, weird.

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

image

PowerShell Version

v7.4.1 x64 on Windows 11 and Pop!_OS / Ubuntu 22.04

Visual Studio Code Version

1.87.2

Extension Version

v2024.0.0 and v2024.3.1-preview

Steps to Reproduce

$SomeVariable
$Error
$PSVersionTable

Visuals

image

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugA bug to squash.Needs: TriageMaintainer attention needed!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions