Skip to content

Fix PowerShell highlighting of built-in constant variables#223

Open
o-l-a-v wants to merge 1 commit intoPowerShell:mainfrom
o-l-a-v:fix/powershell-highlight-constant-built-in-variables
Open

Fix PowerShell highlighting of built-in constant variables#223
o-l-a-v wants to merge 1 commit intoPowerShell:mainfrom
o-l-a-v:fix/powershell-highlight-constant-built-in-variables

Conversation

@o-l-a-v
Copy link

@o-l-a-v o-l-a-v commented Mar 1, 2026

Related VSCode PR: microsoft/vscode#298570

PR Summary

Use a TextMate scope for PowerShell built-in constant variables that most themes actually have defined in tokenColors.

I see that C#, Ruby and Go TextMate files uses variable.other.constant.<language>, so I went with that.

PR Context

For a long time, PowerShell highlighting for built-in constant variables has been broken in VSCode.

image

Some related issues:

I believe I've tracked it down to the PowerShell TextMate using a TextMate scope most themes does not have a definition for:

image

The official Dracula theme even have a workaround just for this https://github.com/dracula/visual-studio-code/blob/main/src/dracula.yml:

  - name: Powershell constants mistakenly scoped to `support`, rather than `constant` (edge)
    scope:
    - support.constant
    settings:
      fontStyle: normal
      foreground: *PURPLE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant