lettuce icon indicating copy to clipboard operation
lettuce copied to clipboard

Rework kotlin generator with kotlin-poet

Open sokomishalov opened this issue 2 years ago • 4 comments

PR goal is to decrease plain string manipulations to build kotlin API code and provide more safety while generating code.

Make sure that:

  • [x] You have read the contribution guidelines.
  • [ ] You have created a feature request first to discuss your contribution intent. Please reference the feature request ticket number in the pull request.
  • [x] You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • [x] You submit test cases (unit or integration tests) that back your changes.

sokomishalov avatar Jul 04 '22 12:07 sokomishalov

Thanks for submitting a pull request. The generated code looks very different from the one that we had. We can only merge this if the resulting code is going to be the same (or have very minor differences). 5000loc of unrelated changes is an overkill currently.

mp911de avatar Jul 04 '22 13:07 mp911de

@mp911de Agree, but the resulting API code is exactly the same unless it wouldn't compile coz it generates only interface layer and implementation layer has not been changed. But still, I've tried to fit kotlinpoet to the previous view and provided these PRs (1,2) that received negative feedback, unfortunately. Anyway, I'll try to figure out something what we can do here.

sokomishalov avatar Jul 04 '22 14:07 sokomishalov

Thanks for the context. Given that Kotlinpoet doesn't seem to want to improve their dev experience and is rather limiting, I start to dislike the entire move into Kotlinpoet.

mp911de avatar Jul 04 '22 14:07 mp911de

JFYI fixed indentation, total diff decreased significantly and now is quite more readable Still trying to find some workarounds with current kotlin-poet API

UPD: appended license header as kdoc manually to the header

sokomishalov avatar Jul 04 '22 16:07 sokomishalov

Let's keep our generator as is for now

sokomishalov avatar Jul 17 '23 09:07 sokomishalov