Fix PowerShell highlighting of built-in constant variables#298570
Open
o-l-a-v wants to merge 1 commit intomicrosoft:mainfrom
Open
Fix PowerShell highlighting of built-in constant variables#298570o-l-a-v wants to merge 1 commit intomicrosoft:mainfrom
o-l-a-v wants to merge 1 commit intomicrosoft:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related PowerShell/EditorSyntax PR: PowerShell/EditorSyntax#223
Fix
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.Context
For a long time, PowerShell highlighting for built-in constant variables has been broken in VSCode.
Some related issues:
$Error,$PSVersionTable) PowerShell/vscode-powershell#4944$Errorand$PSVersionTablePowerShell/EditorSyntax#218I believe I've tracked it down to the PowerShell TextMate using a TextMate scope most themes do not have a definition for:
The official Dracula theme even has a workaround just for this https://github.com/dracula/visual-studio-code/blob/main/src/dracula.yml: