dotnet / vscode-csharp

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

Syntax highlighting on interfaces not working #4352

Closed azydevelopment closed 2 weeks ago

azydevelopment commented 3 years ago

Issue Type: Bug

Create a new C# console program and add this code:

using System;

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }

        public int TempProp { get; set; }
        public int TempMethod();
    }

    interface ITestInterface
    {
        public int TempProp { get; set; }
        public abstract int TempMethod();
    }
}

image

Extension version: 1.23.8 VS Code version: Code 1.52.1 (ea3859d4ba2f3e577a159bc91e3074c5d85c0523, 2020-12-16T16:34:46.910Z) OS version: Windows_NT x64 10.0.18363

azydevelopment commented 3 years ago

Another weird example. The keyword 'struct' is half highlighted. Note: This is code from a nested struct inside an interface definition.

image

filipw commented 3 years ago

This is supported with semantic highlighting. To enable it set:

csharp.semanticHighlighting.enabled and editor.semanticHighlighting.enabled to true.

JoeRobich commented 2 weeks ago

The C# extension now supports semantic highlighting as well as it ships with a much improved textmate grammar.