EditorSyntax
EditorSyntax copied to clipboard
No Syntax Highlighting for `enum` declarations
trafficstars
Prerequisites
- [X] I have written a descriptive issue title.
- [X] I have searched all issues to ensure it has not already been reported.
- [X] I have read the troubleshooting guide.
- [X] I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
Summary
Syntax highlighting for enum declarations in VS Code is non-existent:

PowerShell Version
Name Value
---- -----
PSVersion 7.1.3
PSEdition Core
GitCommitId 7.1.3
OS Microsoft Windows 10.0.19043
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visual Studio Code Version
1.60.0-insider
49af1cbe00271ac2ea36cfc5f7352fe31a7b0094
x64
Extension Version
[email protected]
[email protected]
[email protected]
Steps to Reproduce
Open any .ps1 or .psm1 file with an enum declaration.
Visuals
No response
Logs
No response
Hi,
It appears that a long-standing issue in the PowerShell highlighting grammar is the cause of this.
The extension's built-in (but experimental) semantic highlighting does support enum correctly. You can follow the instructions here to enable that, but it was disabled by default while its stability is improved.
Thanks for the bug report. I'm going to transfer over to the relevant repo.
Duplicate of #29.