Sublime Forum

C# Syntax Highlighting Glitch with 3143

#1

I hope this is not a duplicate report… It looks like the C# syntax highlighting has a glitch with delegates in 3143.
The issue seems to be triggered by a space after the identifier for a delegate (OnHello, OnGoodby in the example below). Lines following such a delegate show incorrect highlighting for me.

namespace CSharpTest
{

    public class BrokenDelegate
        : Singleton<SomeClass>
    {
        public delegate void OnHello (User user);
        public delegate void OnGoodbye (User user);

        public OnHello      onHello;
        public OnGoodbye    onGoodbye;

        public void SayHello (User user)
        {
            if (onHello != null)
                onHello(user);
        }
    }

    public class WorkingDelegate
        : Singleton<SomeClass>
    {
        public delegate void OnHello(User user);
        public delegate void OnGoodbye(User user);

        public OnHello      onHello;
        public OnGoodbye    onGoodbye;

        public void SayHello (User user)
        {
            if (onHello != null)
                onHello(user);
        }
    }

} // namespace CSharpTest
2 Likes

#2

I’ve not seen this reported before, please could you log it at https://github.com/sublimehq/Packages/issues

0 Likes

#3

Done: Issue 1144

1 Like