thrift-typescript icon indicating copy to clipboard operation
thrift-typescript copied to clipboard

Allow * for language choice in namespace declarations

Open r4j4h opened this issue 7 years ago • 2 comments

namespace * MyNamespace

is recommended in https://www.manning.com/books/programmers-guide-to-apache-thrift-cx (please ignore the cancelled message) and compiles fine using the namespace in all languages (that I've tried) using the Apache Thrift code generator.

With thrift-typescript I encounter:

    Parse Failure: 2 errors found:


    Scan Error:

    Message: Unexpected token: *

    4 | namespace * MyNamespace
                  ^


    Parse Error:

    Message: Unable to find name identifier for namespace

    4 | namespace * MyNamespace

I can bypass it by replacing * with js but then I am going to have to duplicate the namespace line for each language I want to support.

Is this an approach that thrift-typescript could support or is my current approach actually a bad idea in practice?

r4j4h avatar Jun 08 '18 07:06 r4j4h

I think supporting the * character makes a lot of sense. We've obviously just included namespaces for all of our supported languages to this point. Don't think this would be a big change, but not sure either when we would have the time to get to it. Will add it to our list of features to support.

kevin-greene-ck avatar Jun 08 '18 17:06 kevin-greene-ck

Stiil doesn`t support it?

STih07 avatar Dec 13 '18 12:12 STih07