Merged
Conversation
…h validation support
… property generation
…on and codegen testing
…on generation and testing
…on and property generation, update configurations, and expand tests
…ansform annotations, nullable scope parameters, and annotation copying behavior.
There was a problem hiding this comment.
Pull Request Overview
Adds markName support to existing annotations (JvmBlocking, JvmAsync, JsPromise) and enables configuration of a custom name‐marker annotation via the Gradle plugin extension. Key changes include:
- Extends Kotlin annotation definitions (common, JVM, JS) with a new
markNameparameter and documentation. - Enhances the Gradle plugin DSL to configure
markNamePropertyand propagate it into generated code. - Updates compiler plugin logic (IR, FIR, copy utilities) to carry
markNamethrough code generation and testing artifacts, and bumps versions accordingly.
Reviewed Changes
Copilot reviewed 19 out of 25 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test-js/src/commonMain/kotlin/markname/MarkNameTestInterface.kt | Adds JS interface tests for markName support |
| tests/test-js/src/commonMain/kotlin/markname/MarkNameTestClass.kt | Adds JS class tests for markName support |
| tests/test-js/build.gradle.kts | Cleans up commented plugin configuration in JS tests |
| tests/build.gradle.kts | Updates plugin version for tests |
| runtime/suspend-transform-annotation/src/commonMain/kotlin/.../SuspendTransformAnnotation.kt | Adds markName expect property and docs to common annotation defs |
| runtime/suspend-transform-annotation/src/jvmMain/kotlin/.../SuspendTransformAnnotationJvm.kt | Adds markName to JVM annotations with docs |
| runtime/suspend-transform-annotation/src/jsMain/kotlin/.../SuspendTransformAnnotationJs.kt | Adds markName to JS annotations with docs |
| plugins/suspend-transform-plugin-gradle/.../SuspendTransformPluginExtension.kt | Introduces markNameProperty in the Gradle extension DSL |
| compiler/suspend-transform-plugin/src/main/kotlin/.../CopyAnnotationUtils.kt | Extends TransformAnnotationData to include markName |
| compiler/suspend-transform-plugin/src/main/kotlin/.../SuspendTransformSyntheticResolveExtension.kt | Adds logic to copy marker annotations when markName is set |
| compiler/suspend-transform-plugin/src/main/kotlin/.../SuspendTransformFirTransformer.kt | Inserts FIR transformer logic to attach marker annotations |
| compiler/suspend-transform-plugin-configuration/.../SuspendTransformConfiguration.kt | Serializes markNameProperty in configuration and default settings |
| compiler/suspend-transform-plugin/src/testData/codegen/markName.kt | Adds codegen input test for markName |
| compiler/suspend-transform-plugin/src/testData/codegen/markName.fir.txt | Adds expected FIR dump for the new test |
| compiler/suspend-transform-plugin/src/test/.../AbstractTestRunner.kt | Configures JVM artifact handlers to include ASM for new test |
| compiler/suspend-transform-plugin/src/test-gen/.../CodeGenTestRunnerGenerated.java | Adds a generated test runner method for testMarkName |
| buildSrc/src/main/kotlin/IProject.kt | Bumps the plugin version to 0.13.0 |
Comments suppressed due to low confidence (3)
compiler/suspend-transform-plugin/src/testData/codegen/markName.kt:1
- Currently we only have a JVM async/blocking codegen test. Consider adding a parallel codegen test for
JsPromise(markName = ...)to verify that@JsNameis generated correctly in JS output.
// FIR_DUMP
Comment on lines
403
to
+404
| // TODO What is explicitReceiver? | ||
| // this.explicitReceiver |
There was a problem hiding this comment.
[nitpick] Remove or explain this commented placeholder. Leaving it may confuse future maintainers about intended behavior.
Suggested change
| // TODO What is explicitReceiver? | |
| // this.explicitReceiver | |
| // TODO Investigate the purpose and usage of explicitReceiver. | |
| // The explicitReceiver might be required for certain function calls or expressions. | |
| // Implementation is pending further clarification of its role in this context. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
see #95
Adds the property
markNameto each of the three existing annotations (JvmBlocking,JvmAsync,JsPromise) in theruntime, which, when specified, adds the corresponding annotation (@JvmName,@JsName) to the generated function (or getter of the property).Warning
Known issues: KT-78473:
@JsNamedoes not work for@JsExportwith property's getter, This may require waiting for an official Kotlin answer or fix for this issue.There is no effect on the function, and it works fine.
In addition, the
markNamePropertyproperty has been added to themarkAnnotationconfiguration item to allow customization of any behavior related tomarkName, e.g., by adding@Deprecated("${markName}")or something like that (or maybe you write your own custom annotation?).For example, the
build.gradle.kts:suspendTransformPlugin { transformers { // others... addJvm { // others... markAnnotation { // others... // config your mark name property here markNameProperty { propertyName = "markName" // The property name in your mark annotation annotation { packageName = "kotlin" className = "Deprecated" propertyName = "message" // The message in @Deprecated(message = "...") } } } } } }