frhagn / Typewriter

Automatic TypeScript template generation from C# source files
http://frhagn.github.io/Typewriter
Apache License 2.0
537 stars 132 forks source link

Typewriter does not seem to be compatible with the latest version of C# 10. #344

Open Xavier-Mobius opened 2 years ago

Xavier-Mobius commented 2 years ago

In the new C# 10 standard namespace can be declared this way : namespace Namespace1.Namespace2; instead of this way. namespace Namespace1.Namespace2 { } but in this case the file is ignored by TypeWriter.

Example :

namespace Namespace1.Namespace2;
public class MyClass
{
    public MyClass(int prop1, string prop1)
    {
        Prop1 = prop1;
        prop2 = prop1;
    }
    public int Prop1 { get; set; }
    public string prop2 { get; set; }
}

is not generated but

namespace Namespace1.Namespace2
{
    public class MyClass
    {
        public MyClass(int prop1, string prop1)
        {
            Prop1 = prop1;
            prop2 = prop1;
        }
        public int Prop1 { get; set; }
        public string prop2 { get; set; }
    }
}

is generated.

jaoude commented 1 year ago

Hi, Were you able to figure out a solution ? Regards

AdaskoTheBeAsT commented 1 year ago

it works in my fork https://github.com/AdaskoTheBeAsT/Typewriter/releases/tag/v2.10.1

jaoude commented 1 year ago

Indeed it worked with VS 17.4.2 and scoped namespaces - thank you