aboutsummaryrefslogtreecommitdiff
path: root/kotlinpoet
AgeCommit message (Collapse)Author
2022-07-21Pass all contents of editorconfig to ktlint (#1305)Egor Andreevich
* Pass all contents of editorconfig to ktlint * Enable trailing comma rules
2022-07-01Update plugin kotlinBinaryCompatibilityValidator to v0.10.1 (#1281)renovate[bot]
* Update plugin kotlinBinaryCompatibilityValidator to v0.10.1 * :kotlinpoet:apiDump * :interop:kotlinx-metadata:apiDump Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Egor Andreevici <egor@squareup.com>
2022-06-21Optimize holder interfaces (#1270)Zac Sweers
2022-06-20Support context receivers on TypeSpecs + extract ContextReceivable API (#1269)Zac Sweers
2022-06-12Promote KSP APIs to stable + integrate ABI validator (#1263)Zac Sweers
2022-06-12Update to Kotlin 1.7 + other deps (#1262)Zac Sweers
Co-authored-by: Egor Andreevich <egor@squareup.com>
2022-06-09Add support for external property getterRoee Hershberg
2022-06-01Fix a bug caused by too long return expressions (#1256)zsub
* Fix a bug caused by too long return expressions * Fix a bug caused by too long return expressions * Auto-identify extra spaces before and after return * Auto-identify extra spaces before and after return * Fix possible array out-of-bounds * Making judgement easy * add comments * Update kotlinpoet/src/test/java/com/squareup/kotlinpoet/FunSpecTest.kt Co-authored-by: Egor Andreevich <github@egorand.dev> * Update kotlinpoet/src/main/java/com/squareup/kotlinpoet/FunSpec.kt Co-authored-by: Egor Andreevich <github@egorand.dev> * Update FunSpec.kt * format if required * spotless Co-authored-by: yuejunyu <yuejunyu.0@bytedance.com> Co-authored-by: Egor Andreevich <github@egorand.dev>
2022-05-14Add a test for #1035Egor Andreevich
2022-05-12Work around KT-52315 (#1248)Daniel Lin
* Work around KT-52315 https://youtrack.jetbrains.com/issue/KT-52315 `header` and `impl` are deprecated and do not behave as modifier keywords anymore... except in this specific case, seemingly. * Simpler approach (escape everywhere) * Rename test function to be more specific Co-authored-by: Egor Andreevich <github@egorand.dev> Co-authored-by: Egor Andreevich <github@egorand.dev>
2022-05-09Add support for context receivers @PropertySpec and fix issues with ↵Nuno Alves de Sousa
annotations (#1247) * Fix context receiver and annotation order @FunSpec Prevent context receivers on accessors Add FunSpec tests: - Annotated function with context receiver - Accessor with context receiver Add context receivers to PropertySpec Add PropertySpec tests: - Var with context receiver - Val without getter with context receiver - Val with context receiver - Annotated val with context receiver * Fix code style * Fix checks on var with context receivers and custom accessors Update tests for vars with context receivers without custom accessors Add test for var with context receivers and custom accessors Fix code style * Update kotlinpoet/src/main/java/com/squareup/kotlinpoet/PropertySpec.kt Co-authored-by: Egor Andreevich <github@egorand.dev> * Update tests Co-authored-by: Egor Andreevich <github@egorand.dev>
2022-04-21Update dependencies (#1240)Egor Andreevich
* Update dependencies * Fix type argument mapping when processing typealiases with KSP
2022-04-19Resolve enum constants when emitting types (#1235)Martin Bonnin
* resolve enum constants * reuse ClassName * yikes, fix typo * better comments * Update kotlinpoet/src/main/java/com/squareup/kotlinpoet/CodeWriter.kt Co-authored-by: Egor Andreevich <github@egorand.dev> Co-authored-by: Egor Andreevich <github@egorand.dev>
2022-04-18Add support for context-receivers (#1233)Michael Rittmeister
* Add API for context receivers * Use existing opt-in annotation and make context-receivers not nullable * Remove collection overloads * Revert unwanted code style changes * Add wrongly remove @JvmOverloads annotation * Add code generator and tests * Apply requested changes - Use proper experimental annotation - Remove not needed overloads - Move contextReceivers parameter to the end * Update kotlinpoet/src/main/java/com/squareup/kotlinpoet/FunSpec.kt Co-authored-by: Zac Sweers <pandanomic@gmail.com> * Apply requested changes - Add more tests - Add new-line after context() * Update test for suggestion * Apply suggestions from code review Co-authored-by: Egor Andreevich <github@egorand.dev> * Apply requested changes * Rename contextReceiver to contextReceivers * Fix compiler error * Update kotlinpoet/src/main/java/com/squareup/kotlinpoet/FunSpec.kt Co-authored-by: Egor Andreevich <github@egorand.dev> * Fix compiler errors in tests * Run spotless * Update kotlinpoet/src/main/java/com/squareup/kotlinpoet/LambdaTypeName.kt Co-authored-by: Zac Sweers <pandanomic@gmail.com> * Apply requested changes * Don't emit context receiver spacing if there are no context receivers * Apply suggestions from code review Co-authored-by: Egor Andreevich <github@egorand.dev> Co-authored-by: Zac Sweers <pandanomic@gmail.com> Co-authored-by: Egor Andreevich <github@egorand.dev>
2022-03-14Emit trailing comma for multi-line annotationsJake Wharton
2022-03-14Emit trailing comma for multi-line parametersJake Wharton
2022-02-28Fail compilation if you only pass one string to ClassNameJake Wharton
2022-02-20Inline val property if its getter is inlineEgor Andreevich
2021-12-03Add basic support for default imports (#1194)Zac Sweers
2021-12-01Add 'yield' to the list of reserved keywordsBoD
2021-11-30Implement basic support for script files via `FileSpec` (#1193)Zac Sweers
2021-11-18Kotlin 1.6.0 (#1188)Egor Andreevich
* Kotlin 1.6.0 * Update KCT * Synthetic method annotations may not always be present * typeNameOf not experimental anymore Co-authored-by: Zac Sweers <pandanomic@gmail.com>
2021-11-08Disallow enum constants and properties called "name" and "ordinal" (#1184)Egor Andreevich
* Disallow enum constants and properties called "name" and "ordinal" * Update kotlinpoet/src/main/java/com/squareup/kotlinpoet/TypeSpec.kt * Fix tests
2021-10-28Enforce only allowed parameter modifiers in ParameterSpecs (#1182)Zac Sweers
2021-10-25Fix toString()'d codeblocks in class delegation (#1177)Zac Sweers
2021-10-20Merge pull request #1174 from glureau/long_type_names_in_commentEgor Andreevich
Fix #1076: Type names in a line comment may break the line
2021-10-19Switch AnnotationSpec.get() to use safer arrayOf() syntax (#1175)Zac Sweers
This allows these annotation specs' members to be more portable regardless of whether it's used as an annotation or constructor called. See https://github.com/square/moshi/pull/1390#issuecomment-944953034 for more details
2021-10-15Fix #1076: Type names in a line comment may break the lineGregory Lureau
2021-10-08Fix #1169: Handle long import with aliased name.Gregory Lureau
2021-09-20Configure Spotless to verify the presence of license headers (#1154)Egor Andreevich
* Configure Spotless to verify the presence of license headers * Run spotlessApply to fill in missing license headers
2021-09-20Unify `TypeAliasTag` API between metadata and KSP (#1152)Zac Sweers
* Extract TypeAliasTag for reuse and simplify API in KSP * Update TestProcessor implementation for new alias API This is based on the implementation for metadata in Moshi, and possibly worth promoting as a util to KotlinPoet itself * I am once again asking IntelliJ to actually rename imports * Spotless
2021-09-20Allow copying a ParameterizedTypeName with new type arguments (#1140)Nicklas Ansman Giertz
2021-09-06Do not use reflection for Unit (#1142)Martin Bonnin
2021-09-04Specify languages in kdoc code fragments (#1141)Goooler
2021-08-27Use delicate APIs rather than noisy logging ones (#1136)Zac Sweers
2021-08-20Move dependency declarations into a version catalog (#1128)Egor Andreevich
2021-08-18Code cleanupsGoooler
2021-08-15Simplify boilerplate in ktsGoooler
2021-08-12Add a doc about kotlin-reflect (#1116)Martin Bonnin
* update doc to mention kotlin-reflect * Update docs/index.md Co-authored-by: Egor Andreevich <github@egorand.dev> * Update docs/index.md Co-authored-by: Egor Andreevich <github@egorand.dev> * Update kotlinpoet/src/main/java/com/squareup/kotlinpoet/TypeName.kt Co-authored-by: Egor Andreevich <github@egorand.dev> * Update kotlinpoet/src/main/java/com/squareup/kotlinpoet/ParameterizedTypeName.kt Co-authored-by: Egor Andreevich <github@egorand.dev> * Update index.md Co-authored-by: Egor Andreevich <github@egorand.dev>
2021-08-11Update docs & licenses to use https (#1118)Goooler
* Replace all http with https in apache licenses * Replace all http with https in oracle docs
2021-08-10Simplify kts (#1117)Goooler
* Simplify tasks * Remove kotlinDslPluginOptions
2021-07-01Avoid escaping already escaped stringidanakav
Fix by avoiding a short circuit and making sure we evaluate !alreadyEscaped
2021-06-21Add MemberName.isExtension and update importing logic (#1091)Egor Andreevich
* Add MemberName.isExtension and update importing logic * spotless
2021-06-21Escape members that contains only underscores (#1100)Anton Bashirov
* Escape members that contains only underscores: `data class(val `____`: String)` * remove underscore keyword * fix failed tests * add allStringsAreEscaped test * rename test
2021-06-16Emit empty primary constructorpavlospt
Fixes #1093
2021-05-30Proposal PR: Add DelicateKotlinPoetApi (#1088)Zac Sweers
2021-05-06Update Kotlin + kotlinx-metadata to 1.5 and 0.3.0 (#1079)Zac Sweers
2021-05-03Adding ability to change initializers and defaultValues after being set (#1075)Dallas Gutauckis
* Adding ability to changg initializers and defaultValues after initial set * Making double initialization and similar possible
2021-04-30Add a withIndent CodeBlock builder function. (#1073)Paul Woitaschek
* Add a withIndent CodeBlock builder function. * Remove the duplciated `the`
2021-03-29Omit redundant abstract modifiers on members where possible (#1057)Zac Sweers