vscode-powershell icon indicating copy to clipboard operation
vscode-powershell copied to clipboard

The automatic variable $PSHOME is not highlighted

Open cos4ni2s opened this issue 8 months ago • 3 comments

Prerequisites

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

Summary

I am experiencing a problem with syntax highlighting. I think $PSHOME should be highlighted but it is not.

PowerShell Version

7.5.0

Visual Studio Code Version

1.98.2

Extension Version

2025.0.0

Steps to Reproduce

Type $PSHOME in the Visual Studio Code Text Editor area.

Visuals

Image

Logs

No response

cos4ni2s avatar Apr 03 '25 15:04 cos4ni2s

Thanks for your submission!

Unfortunately that highlighting comes from a Textmate file that is very difficult to get changes pushed because it lands in the main vscode. Note that it is highlighted if semantic versioning is enabled, but that currently has some stability issues.

Image

JustinGrote avatar Apr 03 '25 17:04 JustinGrote

To be fair, that TextMate grammar is due for some TLC. Just very careful TLC.

andyleejordan avatar Apr 03 '25 17:04 andyleejordan

the grammar file comes from here https://github.com/PowerShell/EditorSyntax/blob/main/PowerShellSyntax.tmLanguage

  • https://github.com/PowerShell/EditorSyntax/issues/218

here's my VSCode extension to help with authoring TextMate grammars https://marketplace.visualstudio.com/items?itemName=RedCMD.tmlanguage-syntax-highlighter

RedCMD avatar Aug 15 '25 05:08 RedCMD