-
Notifications
You must be signed in to change notification settings - Fork 4
Support markName
#96
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
Support markName
#96
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
markName
parameter and documentation. - Enhances the Gradle plugin DSL to configure
markNameProperty
and propagate it into generated code. - Updates compiler plugin logic (IR, FIR, copy utilities) to carry
markName
through 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@JsName
is generated correctly in JS output.
// FIR_DUMP
// TODO What is explicitReceiver? | ||
// this.explicitReceiver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Remove or explain this commented placeholder. Leaving it may confuse future maintainers about intended behavior.
// 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. |
Copilot uses AI. Check for mistakes.
see #95
Adds the property
markName
to 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:
@JsName
does not work for@JsExport
with 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
markNameProperty
property has been added to themarkAnnotation
configuration 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
: