dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.88k stars 676 forks source link

switch expressions are not correctly highlighted #4678

Closed mrcharles closed 1 week ago

mrcharles commented 3 years ago

Issue Type: Bug

You can paste the code example from https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/switch-expression into a C# file and see that the word "switch" does not highlight.

"switch" is a keyword and should highlight as such.

Extension version: 1.23.13 VS Code version: Code 1.58.2 (c3f126316369cd610563c75b1b1725e0679adfb3, 2021-07-14T22:10:15.214Z) OS version: Windows_NT x64 10.0.19042 Restricted Mode: No

JoeRobich commented 3 years ago

@mrcharles This sounds like an issue with the C# textmate grammar which is in the https://github.com/dotnet/csharp-tmLanguage repo.

As a work around, you can set csharp.semanticHighlighting.enabled to true to enable semantic highlighting.

JoeRobich commented 1 week ago

Closing as the C# extension now ships with semantic highlight support as well as an improved textmate grammar