-
Couldn't load subscription status.
- Fork 89
cross-compile codegen module against scala3 #1717
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
base: series/0.18
Are you sure you want to change the base?
Conversation
| import scala.reflect.runtime.universe._ | ||
| val str = Literal(Constant(raw)) | ||
| .toString() | ||
| // Escape the string as a Scala literal (surround with quotes, escape special characters) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
homestly I think we should just use scalameta for small things like these (rendering constants)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fine, if you want to pull it I don't mind. But don't get your hopes up about rewriting the codegen in scalameta
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I'm not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it in the past and while having the snippets to compile at the same time you compile your code is mind-blowing there was a lot of hassle sometimes to get them right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, the ancestor to smithy4s was actually written with scalameta. Lots of friction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hints:
libraryDependencies += ("org.scalameta" %% "scalameta" % "4.11.0").cross(CrossVersion.for3Use2_13)scala.meta.Lit.String(s).printSyntaxFor(scala.meta.dialects.Scala3)
that's how I use it in https://github.com/kubukoz/smithy-playground/blob/c34be16f534795041295f4379a6ca8040297c4b1/modules/parser-gen/src/main/scala/playground/parsergen/ParserGen.scala#L355C25-L355C92 anyway
|
we'll need this for #1790. @ghostbuster91 how do you feel about finishing this up? |
|
Sounds like a good case. I will try to do this this week. |
PR Checklist (not all items are relevant to all PRs)