madskristensen / WebEssentials2013

Visual Studio extension
http://vswebessentials.com
Other
945 stars 252 forks source link

Issue with partial class when creating TypeScript intellisense file #1958

Open erkkiholttinen opened 9 years ago

erkkiholttinen commented 9 years ago

When generating TypeScript intellisense file from a partial class, only first encountered part of the class is handled.

Example code:

namespace Dummy {
    public partial class ClassA {
        public string Prop1 { get; set; }
    }

    public partial class ClassA {
        public string Prop2 { get; set; }
    }

    public class ClassB {
        public ClassA Prop { get; set; }
    }
}

When creating TypeScript intellisense file from this the result is:

declare module server {
    interface ClassA {
        prop1: string;
    }
    interface ClassB {
        prop: server.ClassA;
    }
}

From this we can see that prop2 is missing from ClassA. When changing the order of the partial class declarations, one can note that the intellisense file changes always to show the property from the first encountered declaration.