Skip to content
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

Format codegen from long named preview parameter provider so it compiles #241

Merged
merged 1 commit into from
Aug 3, 2022

Conversation

oas004
Copy link
Contributor

@oas004 oas004 commented Jul 13, 2022

Thanks for an awesome library! I really like this! Good job! 😃 🤩

I found that if you have a long named preview parameter provider, the code that was generated was not formatted correctly and resulting in a compile error. Before, the lambda would start the bracket on the next line and it would not compile. Now, I have the lambda start on the next line and formatted the line. I think this should fix #192 also :)

Before

MyProvider().values.iterator.asSequence.forEachIndexed
{ index, previewParam ->

Now

MyProvider()
    .values
    .iterator
    .asSequence.forEachIndexed { index, previewParam ->

I have added a test for this as well in the :showkase-processor-testing module. Is that enough?

@oas004 oas004 force-pushed the fix/long-provider-name-godegen branch from 5bf07ed to b579305 Compare July 16, 2022 21:21
@oas004
Copy link
Contributor Author

oas004 commented Jul 16, 2022

@vinaygaba Rebased and fixed tests according to #238 😄

@oas004 oas004 force-pushed the fix/long-provider-name-godegen branch from b579305 to 2f43ccd Compare July 20, 2022 07:32
Copy link
Collaborator

@vinaygaba vinaygaba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic improvement. Apologize for the delay in reviewing it. Really grateful for all the contributions you've made lately ❤️

@vinaygaba vinaygaba merged commit 868b0d5 into airbnb:master Aug 3, 2022
@oas004 oas004 deleted the fix/long-provider-name-godegen branch August 3, 2022 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Long lines in generated code is formatted incorrectly, leading to compilation error
2 participants