Code Monkey home page Code Monkey logo

typewriter's People

Contributors

aluanhaddad avatar coolkev avatar flayngordt avatar floatas avatar frhagn avatar johannordin avatar jonstelly avatar jotabe-net avatar juliogold avatar marcel1024 avatar michael-tajmajer-emrsn avatar michaelaird avatar mike-ward avatar msawczyn avatar plasmaboyer avatar primalzed avatar rodro75 avatar seriousm avatar skubekk avatar tiesont avatar tolemac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

typewriter's Issues

Generic lists

List<List<MyClass>> should give Array<Array<MyClass>> when using $Type.
It gives List[] not a valid type.

Array.IsPrimitive with Roslyn throws nullreference exception

If I have an array ([]) type in my C#-code an try to access $Type.IsPrimitive in VS 2015 i get the following exception:
System.NullReferenceException: Object reference not set to an instance of an object. at Typewriter.Metadata.Roslyn.Extensions.GetFullName(ISymbol symbol) at Typewriter.Metadata.Roslyn.Extensions.GetFullName(ISymbol symbol) at Typewriter.Metadata.Roslyn.RoslynTypeMetadata.get_FullName() at Typewriter.CodeModel.Helpers.IsPrimitive(ITypeMetadata metadata) at Typewriter.CodeModel.Implementation.TypeImpl.get_IsPrimitive() at __Typewriter.__Code.<>c.<DataParameter>b__8_0(Parameter p) at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source, Func2 predicate) at __Typewriter.__Code.DataParameter(Method m)

Any type of Array seems to reproduce this problem.

Debugging templates

Hey All,

I was wondering how to debug these templates? I'm writing some custom extension methods and i'm not getting a lot of feedback on why the code is not generating.

Thanks!

Convert dynamic properties to any?

Seems like a sane type mapping:

public class Thing {
    public dynamic Value { get; set; }
}

Converted to:

public class Thing {
    Value: any;
}

BaseClass returns "Object" for all classes

all classes returns "Object" as baseClass (since all types inherits object).
should be empty if no inheritance exists.

using template $Name extends $BaseClass
public class WithoutBase { } should return WithoutBase extends. (now returns WithoutBase extends Object)
public class WithBase : WithoutBase { } should return WithBase extends WithoutBase

Thx!

Some of the templates are not working

I tried using the angular and model templates and some of the helpers don't seem to be working.

I'm not seeing any references to $rootnamespace$ in the code.

Inheritance

Does Typewriter support inheritance?

public class Report {}

public class SpecificReport : Report {}

Use standard c# method syntax for custom extensions methods

In order to implement proper IntelliSense for custom methods we need to change the lambda style syntax of custom methods to a more standard c# method syntax.

So instead of

var LoudName = (Class c) => c.Name.ToUpper();

The new syntax will look like this

string LoudName(Class class)
{
   return class.Name.ToUpper();
}

Add support for nested classes

Given class like this:

public class TestClass {
      public class NestedClass {
           public void Method(TestClass tc, NestedClass nc) {  

        }
    }
}

With a typescript-template like this:

$Classes[module App$IsNested[$Parent[.$Name]] { 
     export class $name { $Methods[
     $name ($Parameters[$name: $Type])]{
    }
  }
}

Should return this:

module App { 
   export class TestClass { 
   }
 }

module App.TestClass { 
   export class NestedClass { 
        method(tc: TestClass, nc: TestClass.NestedClass) {
        } 
  } 
}

add support for using generics when using $Type

public MyGenericClass<int> should give MyGenericClass<int> when using $Type

public List<MyGenericClass<int>> should give MyGenericClass<int>[] when using $Type

public class MyGenericClass<T> { private T genericProperty } should give T when using $Type for the property.

Optional type

Is there anyway to generate typescript definition with optional type? This is especially important when trying to generate typescript interfaces automatically

Add support for events and delegates

Please add the full support for all declaration types including events and delegates.
Currently, I use TypeWriter to generate a custom websocket wrapper which is able at the javascript side to invoke methods on the server (exposed using typewriter) and to listen to events raised at the server end and invoke subscriber functions (handwriten but could be exposed by typewriter as well).

Thanks so much for a perfectly working extension.

Reserved word C# @... syntax needs @ removed

If you have a C# method with a parameter that starts with a @ to use a reserved word:

void ProcessEvent(SomeEvent @event) { ... }

The @ sign needs to be removed for $Name, etc...

Visual Studio RTM

This extension stops working on the RTM version of Visual Studio 2015. it might be just my installation. Is there any log that I can check?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.