diff --git a/compiler/test-infrastructure-utils/tests/org/jetbrains/kotlin/test/TestMetadata.java b/compiler/test-infrastructure-utils/tests/org/jetbrains/kotlin/test/TestMetadata.java
index 6cbfee575f7..c6358b2eff0 100644
--- a/compiler/test-infrastructure-utils/tests/org/jetbrains/kotlin/test/TestMetadata.java
+++ b/compiler/test-infrastructure-utils/tests/org/jetbrains/kotlin/test/TestMetadata.java
@@ -21,6 +21,20 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+/**
+ * Used by DevKit IDE Plugin to find "related testData".
+ * Plugin provides various IDE-assistance (e.g. "NavigateToTestData"-actions and gutter icons).
+ *
+ * The main annotation is @[com.intellij.testFramework.TestDataPath].
+ * @[TestDataPath] is usually set on the base class, and @[TestMetadata] - on test methods.
+ * Without @[TestMetadata], a path based on test name is computed:
+ *
+ *
+ * | Lookup rule | Test name | Related testData path |
+ * | default | testFoo | '{argument-of-@TestDataPath}/foo' |
+ * | with @[TestMetadata] | testFoo | '{argument-of-@TestDataPath}/{argument-of-@TestMetadata}' |
+ *
+ */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.TYPE})
public @interface TestMetadata {
diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/testbase/kotlinSourceFileTransformations.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/testbase/kotlinSourceFileTransformations.kt
index c2de489b54c..bd707c07f21 100644
--- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/testbase/kotlinSourceFileTransformations.kt
+++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/testbase/kotlinSourceFileTransformations.kt
@@ -11,11 +11,21 @@ import java.util.concurrent.atomic.AtomicInteger
import kotlin.io.path.appendText
+/**
+ * Appends top-level `private val` to the content of the file.
+ * Throws SecurityException or IOException, if append failed.
+ * Every call to [addPrivateVal] or [addPublicVal] generates a new value name.
+ */
fun Path.addPrivateVal(): Path {
appendText("\nprivate val integerValue${changeCounter.incrementAndGet()} = 24\n")
return this
}
+/**
+ * Appends top-level `public val` to the content of the file.
+ * Throws SecurityException or IOException, if append failed.
+ * Every call to [addPrivateVal] or [addPublicVal] generates a new value name.
+ */
fun Path.addPublicVal(): Path {
appendText("\nval integerValue${changeCounter.incrementAndGet()} = 25\n")
return this