atom / language-csharp

C# language support for Atom
Other
62 stars 53 forks source link

Generic Parameters break method signature parsing #50

Closed andycmaj closed 7 years ago

andycmaj commented 8 years ago

Notice how method names with Generic parameters aren't parsed as entity.name.function.cs. You can tell because Register<TEvent> has no style applied.

Also, Generic parameters aren't recognized in method return-types.

broken method signatures

sample code:

        // Broken
        public IDisposable Register<TEvent, THandler>()
            where TEvent : IEvent
            where THandler : IEventHandler<TEvent>, new()
        {
        }

        // OK
        public IDisposable Register(Type eventType, IEventHandler handler)
        {
        }

        // Broken
        public IDisposable Register<TEvent>(IEventHandlerFactory handlerFactory) where TEvent : IEvent
        {
        }

        // Returntype broken
        public IDisposable<TEvent, TBar> Register(Type eventType, IEventHandlerFactory handlerFactory)
        {
        }
damieng commented 7 years ago

Has been fixed in master and should ship in the next beta, here's a screenshot of your code.

image

Note that return-types featuring multiple generic arguments are not yet processed correctly and we're going to track that in #88