-
Notifications
You must be signed in to change notification settings - Fork 1.4k
MethodSpec.beginControlFlow inserts unneccessary space when argument is empty #795
Comments
Sounds like a legit use case. I'd actually suggest adding a no-arg |
I'm not sure this is control flow though. You could build the block contents in a |
@JakeWharton I think this would be a quite theoretical distinction. Is this a control flow then?
|
As far as JavaPoet is concerned yes. The library does not care what the semantic meaning your code has, we merely care about its syntactical form. |
Hi, I have created a PR for this issue, please review and let me know if it looks good for merge: |
I added a no-arg beginControlFlow() overload in addition to fixing the behavior for the empty string case. |
I want to write code like this:
To generate the code blocks, I use
This works almost as expected, but the curly braces don't line up. Would it be possible to remove the extra space when beginControlFlow gets an empty argument?
The text was updated successfully, but these errors were encountered: