-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Alternate to '$' syntax for substitutions? #831
Comments
Here's an easy workaround I've used in the past: private const val T = "\$T" |
This works but you need to be careful with type parameters in places you import those constants. In particular, a reified type parameter inline fun <reified T> MethodSpec.Builder.addAnnotation(builderAction: AnnotationSpec.Builder.() -> Unit) {
val clazz = T::class.java
val annotationBuilder = AnnotationSpec.builder(clazz)
builderAction(annotationBuilder)
addAnnotation(annotationBuilder.build())
} |
@kevinherron , you might want to check #761 (comment) An alternative approach for Kotlin would be to apply JetPack Compose for building the AST. |
Any chance of adding an alternate character that can be used when specifying substitions (
$T
,$L
,$S
etc...)?$
is a real bummer to use from Kotlin.Regular Strings are kinda bad:
Multi-line Strings are even worse:
The text was updated successfully, but these errors were encountered: