From 164b68b0c40fbd6038ce812ce80ced0b67a1bec1 Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Fri, 22 Mar 2024 16:58:28 +0100 Subject: [PATCH] [kotlin] k2 quick doc: add test data for positive cases in KTIJ-27105 GitOrigin-RevId: b110f4cd251c66e7c33ac6d4ebfd718593e4f956 --- .../FirQuickDocTestGenerated.java | 20 +++++++++++++++++++ .../QuickDocProviderTestGenerated.java | 20 +++++++++++++++++++ .../testData/editor/quickDoc/Annotation.kt | 5 +++++ .../testData/editor/quickDoc/ObjectLiteral.kt | 10 ++++++++++ .../quickDoc/PropertiesInConstructor.kt | 9 +++++++++ .../quickDoc/TypeParameterConstraints.kt | 9 +++++++++ 6 files changed, 73 insertions(+) create mode 100644 plugins/kotlin/idea/tests/testData/editor/quickDoc/Annotation.kt create mode 100644 plugins/kotlin/idea/tests/testData/editor/quickDoc/ObjectLiteral.kt create mode 100644 plugins/kotlin/idea/tests/testData/editor/quickDoc/PropertiesInConstructor.kt create mode 100644 plugins/kotlin/idea/tests/testData/editor/quickDoc/TypeParameterConstraints.kt diff --git a/plugins/kotlin/fir/tests/test/org/jetbrains/kotlin/idea/fir/documentation/FirQuickDocTestGenerated.java b/plugins/kotlin/fir/tests/test/org/jetbrains/kotlin/idea/fir/documentation/FirQuickDocTestGenerated.java index b750399a28c0..f25545dd947e 100644 --- a/plugins/kotlin/fir/tests/test/org/jetbrains/kotlin/idea/fir/documentation/FirQuickDocTestGenerated.java +++ b/plugins/kotlin/fir/tests/test/org/jetbrains/kotlin/idea/fir/documentation/FirQuickDocTestGenerated.java @@ -33,6 +33,11 @@ public class FirQuickDocTestGenerated extends AbstractFirQuickDocTest { runTest("../../idea/tests/testData/editor/quickDoc/AbstractCallableInInterface.kt"); } + @TestMetadata("Annotation.kt") + public void testAnnotation() throws Exception { + runTest("../../idea/tests/testData/editor/quickDoc/Annotation.kt"); + } + @TestMetadata("AnonymousObjectLocalVariable.kt") public void testAnonymousObjectLocalVariable() throws Exception { runTest("../../idea/tests/testData/editor/quickDoc/AnonymousObjectLocalVariable.kt"); @@ -173,6 +178,11 @@ public class FirQuickDocTestGenerated extends AbstractFirQuickDocTest { runTest("../../idea/tests/testData/editor/quickDoc/MethodFromStdLib.kt"); } + @TestMetadata("ObjectLiteral.kt") + public void testObjectLiteral() throws Exception { + runTest("../../idea/tests/testData/editor/quickDoc/ObjectLiteral.kt"); + } + @TestMetadata("OnActualDeclaration.kt") public void testOnActualDeclaration() throws Exception { runTest("../../idea/tests/testData/editor/quickDoc/OnActualDeclaration.kt"); @@ -333,6 +343,11 @@ public class FirQuickDocTestGenerated extends AbstractFirQuickDocTest { runTest("../../idea/tests/testData/editor/quickDoc/OnPropertyUsageDocumentedWithPropertyTag.kt"); } + @TestMetadata("PropertiesInConstructor.kt") + public void testPropertiesInConstructor() throws Exception { + runTest("../../idea/tests/testData/editor/quickDoc/PropertiesInConstructor.kt"); + } + @TestMetadata("renderAnnotatedExtensionFunctionType.kt") public void testRenderAnnotatedExtensionFunctionType() throws Exception { runTest("../../idea/tests/testData/editor/quickDoc/renderAnnotatedExtensionFunctionType.kt"); @@ -362,4 +377,9 @@ public class FirQuickDocTestGenerated extends AbstractFirQuickDocTest { public void testTypeNamesFromStdLibNavigation() throws Exception { runTest("../../idea/tests/testData/editor/quickDoc/TypeNamesFromStdLibNavigation.kt"); } + + @TestMetadata("TypeParameterConstraints.kt") + public void testTypeParameterConstraints() throws Exception { + runTest("../../idea/tests/testData/editor/quickDoc/TypeParameterConstraints.kt"); + } } diff --git a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/editor/quickDoc/QuickDocProviderTestGenerated.java b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/editor/quickDoc/QuickDocProviderTestGenerated.java index dba9839583b2..157200030367 100644 --- a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/editor/quickDoc/QuickDocProviderTestGenerated.java +++ b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/editor/quickDoc/QuickDocProviderTestGenerated.java @@ -33,6 +33,11 @@ public class QuickDocProviderTestGenerated extends AbstractQuickDocProviderTest runTest("testData/editor/quickDoc/AbstractCallableInInterface.kt"); } + @TestMetadata("Annotation.kt") + public void testAnnotation() throws Exception { + runTest("testData/editor/quickDoc/Annotation.kt"); + } + @TestMetadata("AnonymousObjectLocalVariable.kt") public void testAnonymousObjectLocalVariable() throws Exception { runTest("testData/editor/quickDoc/AnonymousObjectLocalVariable.kt"); @@ -173,6 +178,11 @@ public class QuickDocProviderTestGenerated extends AbstractQuickDocProviderTest runTest("testData/editor/quickDoc/MethodFromStdLib.kt"); } + @TestMetadata("ObjectLiteral.kt") + public void testObjectLiteral() throws Exception { + runTest("testData/editor/quickDoc/ObjectLiteral.kt"); + } + @TestMetadata("OnActualDeclaration.kt") public void testOnActualDeclaration() throws Exception { runTest("testData/editor/quickDoc/OnActualDeclaration.kt"); @@ -333,6 +343,11 @@ public class QuickDocProviderTestGenerated extends AbstractQuickDocProviderTest runTest("testData/editor/quickDoc/OnPropertyUsageDocumentedWithPropertyTag.kt"); } + @TestMetadata("PropertiesInConstructor.kt") + public void testPropertiesInConstructor() throws Exception { + runTest("testData/editor/quickDoc/PropertiesInConstructor.kt"); + } + @TestMetadata("renderAnnotatedExtensionFunctionType.kt") public void testRenderAnnotatedExtensionFunctionType() throws Exception { runTest("testData/editor/quickDoc/renderAnnotatedExtensionFunctionType.kt"); @@ -362,4 +377,9 @@ public class QuickDocProviderTestGenerated extends AbstractQuickDocProviderTest public void testTypeNamesFromStdLibNavigation() throws Exception { runTest("testData/editor/quickDoc/TypeNamesFromStdLibNavigation.kt"); } + + @TestMetadata("TypeParameterConstraints.kt") + public void testTypeParameterConstraints() throws Exception { + runTest("testData/editor/quickDoc/TypeParameterConstraints.kt"); + } } diff --git a/plugins/kotlin/idea/tests/testData/editor/quickDoc/Annotation.kt b/plugins/kotlin/idea/tests/testData/editor/quickDoc/Annotation.kt new file mode 100644 index 000000000000..13896dc7d37d --- /dev/null +++ b/plugins/kotlin/idea/tests/testData/editor/quickDoc/Annotation.kt @@ -0,0 +1,5 @@ +annotation class Anno + +//K2_INFO:
public final annotation class Anno
 Annotation.kt
+//INFO:
public final annotation class Anno
+//INFO:     : Annotation
 Annotation.kt
diff --git a/plugins/kotlin/idea/tests/testData/editor/quickDoc/ObjectLiteral.kt b/plugins/kotlin/idea/tests/testData/editor/quickDoc/ObjectLiteral.kt new file mode 100644 index 000000000000..16e276b35441 --- /dev/null +++ b/plugins/kotlin/idea/tests/testData/editor/quickDoc/ObjectLiteral.kt @@ -0,0 +1,10 @@ +interface I + +fun m() { + object : I {} +} + +//K2_INFO:
object : I
+//INFO:
local final class `<no name provided>`
+//INFO:     : I
+ diff --git a/plugins/kotlin/idea/tests/testData/editor/quickDoc/PropertiesInConstructor.kt b/plugins/kotlin/idea/tests/testData/editor/quickDoc/PropertiesInConstructor.kt new file mode 100644 index 000000000000..ce4c31def370 --- /dev/null +++ b/plugins/kotlin/idea/tests/testData/editor/quickDoc/PropertiesInConstructor.kt @@ -0,0 +1,9 @@ +class Foo(val p: String) + +//K2_INFO:
public constructor Foo(
+//K2_INFO:     public final val p: String
+//K2_INFO: )
 Foo
+ +//INFO:
public constructor Foo(
+//INFO:     val p: String
+//INFO: )

 Foo
diff --git a/plugins/kotlin/idea/tests/testData/editor/quickDoc/TypeParameterConstraints.kt b/plugins/kotlin/idea/tests/testData/editor/quickDoc/TypeParameterConstraints.kt new file mode 100644 index 000000000000..e34d3bf3d3ff --- /dev/null +++ b/plugins/kotlin/idea/tests/testData/editor/quickDoc/TypeParameterConstraints.kt @@ -0,0 +1,9 @@ +interface I1 +interface I2 +fun bar() where T: I2 { +} + + +//K2_INFO:
public fun <T> bar(): Unit where T : I1, T : I2
 TypeParameterConstraints.kt
+//INFO:
public fun <T : I1> bar(): Unit where T : I2

 TypeParameterConstraints.kt
+