scalacenter / scala-syntax

Scalameta pretty printer for better Scalafix refactorings
Apache License 2.0
17 stars 6 forks source link

Crack the code on comments? #10

Closed olafurpg closed 6 years ago

olafurpg commented 6 years ago

This commit implements facilities to attach leading/trailing comments to tree nodes. This opens possibilities to use quasiquotes to generate Scala source code. This feature is implemented by embedding the comments in the private .origin field. The .origin.input is of type Input.Stream(Comments), because that was the only Input I could see where we can attach custom metadata by extending java.io.InputStream. We should clearly extend scalameta to avoid such hacks.