PowerShell / EditorSyntax

PowerShell syntax highlighting for editors (VS Code, Atom, SublimeText, TextMate, etc.) and GitHub!
MIT License
131 stars 42 forks source link

No Syntax Highlighting for `enum` declarations #209

Open rbuckton opened 3 years ago

rbuckton commented 3 years ago

Prerequisites

Summary

Syntax highlighting for enum declarations in VS Code is non-existent:

image

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

ms-vscode.powershell@2021.5.1
ms-vscode.powershell@2021.6.2
ms-vscode.powershell-preview@2021.8.0

Steps to Reproduce

Open any .ps1 or .psm1 file with an enum declaration.

Visuals

No response

Logs

No response

andyleejordan commented 3 years ago

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.

andyleejordan commented 3 years ago

Duplicate of #29.