-
Notifications
You must be signed in to change notification settings - Fork 286
-
Notifications
You must be signed in to change notification settings - Fork 286
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
CodeBlock.builder() is missing addComment() method #1690
Comments
What would be a use-case for it? A comment is a CodeBlock. |
I am forced to do (as I am in a sub-function that only has a CodeBlock.builder() instance and not its FunSpec.builder()
as there just is missing a
but with addStatement("// ...") |
Yeah, I think that makes sense. I originally felt like "comment" is a concept on a higher level than "CodeBlock", and there are many things we represent with CodeBlocks which don't support comments, but that said, we do have API like Meanwhile you can copy what public fun addComment(format: String, vararg args: Any): Builder = apply {
body.add("//·${format.replace(' ', '·')}\n", *args)
} |
Why does CodeBlock.builder() not have addComment() method like e.g. FunSpec.builder() ?
The text was updated successfully, but these errors were encountered: