Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make generated code look nicer? #368

Open
raboof opened this issue Aug 23, 2018 · 4 comments
Open

Make generated code look nicer? #368

raboof opened this issue Aug 23, 2018 · 4 comments

Comments

@raboof
Copy link
Member

raboof commented Aug 23, 2018

Because of the loops in our templates, the whitespace in the generated code is quite jumbled-up.

Since people may be looking at the generated code, it might be worth it to tweak some things to make the generated code look neater at the cost of making the templates less easily readable.

@johanandren
Copy link
Member

I'm not sure it is a good idea, we also need to maintain that template, and flattening it to make the generated code "normal" makes the template very hard to read.

@patriknw
Copy link
Member

Perhaps related to playframework/twirl#141 ?

@johanandren
Copy link
Member

Yeah, if twirl could output something that looks nice without much tweaking the template source that would be awesome.

@dwijnand dwijnand reopened this Aug 30, 2018
@dwijnand
Copy link
Member

Here are the steps I used to have a look at this (thanks @raboof for the help!):

  1. akka-grpc-play-interop-test-scala/test:products
  2. check play-interop-test-scala/target/scala-2.12/src_managed/main/example/myapp/helloworld/grpc/helloworld/GreeterServiceClient.scala

Given playframework/twirl#169 I tried upgrade sbt-twirl to 1.3.14, but GreeterServiceClient.scala still contains:

    private val sayHelloRequestBuilder = {
      
        new ScalaUnaryRequestBuilder(sayHelloDescriptor, channel, options, settings)
      
    }

/cc @mkurz who authored the change in twirl. Do you know why the indentation isn't fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants