diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt index 3f350c47e4e..8305e2ada3c 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt @@ -1014,37 +1014,24 @@ fun main(args: Array) { model("analysisSession/resolveCall") } - testClass { - model("symbolsByPsi") - } - - testClass { - model("symbolsByFqName", extension = "txt") - } - - - testClass { - model("symbolByReference") - } - testClass { - model("memberScopeByFqName", extension = "txt") + model("memberScopeByFqName") } testClass { model("fileScopeTest", extension = "kt") } - testClass { - model("symbolPointer", extension = "kt") + testClass { + model("symbols/symbolByPsi") } - testClass { - model("resoreSymbolFromLibrary") + testClass { + model("symbols/symbolByFqName") } - testClass { - model("symbolByReference") + testClass { + model("symbols/symbolByReference") } testClass { diff --git a/idea/idea-frontend-fir/testData/memberScopeByFqName/Int.txt b/idea/idea-frontend-fir/testData/memberScopeByFqName/Int.kt similarity index 99% rename from idea/idea-frontend-fir/testData/memberScopeByFqName/Int.txt rename to idea/idea-frontend-fir/testData/memberScopeByFqName/Int.kt index 9132a7f9f92..1ff31f75123 100644 --- a/idea/idea-frontend-fir/testData/memberScopeByFqName/Int.txt +++ b/idea/idea-frontend-fir/testData/memberScopeByFqName/Int.kt @@ -1,6 +1,10 @@ -class: kotlin/Int +// WITH_RUNTIME +// DO_NOT_CHECK_SYMBOL_RESTORE -// SYMBOLS: +// class: kotlin/Int + +// RESULT +/* KtFirFunctionSymbol: annotatedType: [] kotlin/Int annotationClassIds: [] @@ -1313,3 +1317,4 @@ KtFirConstructorSymbol: typeParameters: [] valueParameters: [] visibility: PRIVATE +*/ diff --git a/idea/idea-frontend-fir/testData/memberScopeByFqName/MutableList.txt b/idea/idea-frontend-fir/testData/memberScopeByFqName/MutableList.kt similarity index 99% rename from idea/idea-frontend-fir/testData/memberScopeByFqName/MutableList.txt rename to idea/idea-frontend-fir/testData/memberScopeByFqName/MutableList.kt index 47ece7fb3f1..6f203c14cb0 100644 --- a/idea/idea-frontend-fir/testData/memberScopeByFqName/MutableList.txt +++ b/idea/idea-frontend-fir/testData/memberScopeByFqName/MutableList.kt @@ -1,6 +1,7 @@ -class: kotlin/collections/MutableList +// class: kotlin/collections/MutableList -// SYMBOLS: +// RESULT +/* KtFirFunctionSymbol: annotatedType: [] kotlin/Boolean annotationClassIds: [] @@ -507,3 +508,4 @@ KtFirFunctionSymbol: typeParameters: [] valueParameters: [] visibility: PUBLIC +*/ diff --git a/idea/idea-frontend-fir/testData/memberScopeByFqName/java.lang.String.txt b/idea/idea-frontend-fir/testData/memberScopeByFqName/java.lang.String.kt similarity index 99% rename from idea/idea-frontend-fir/testData/memberScopeByFqName/java.lang.String.txt rename to idea/idea-frontend-fir/testData/memberScopeByFqName/java.lang.String.kt index fd13996cbba..1922ae489e8 100644 --- a/idea/idea-frontend-fir/testData/memberScopeByFqName/java.lang.String.txt +++ b/idea/idea-frontend-fir/testData/memberScopeByFqName/java.lang.String.kt @@ -1,6 +1,9 @@ -class: java/lang/String +// DO_NOT_CHECK_SYMBOL_RESTORE -// SYMBOLS: +// class: java/lang/String + +// RESULT +/* KtFirJavaFieldSymbol: annotatedType: [] ft callableIdIfNonLocal: java.lang.String.value @@ -1470,3 +1473,4 @@ KtFirConstructorSymbol: typeParameters: [] valueParameters: [KtFirConstructorValueParameterSymbol(offset), KtFirConstructorValueParameterSymbol(count), KtFirConstructorValueParameterSymbol(value)] visibility: UNKNOWN +*/ diff --git a/idea/idea-frontend-fir/testData/memberScopeByFqName/kotlin.Function2.txt b/idea/idea-frontend-fir/testData/memberScopeByFqName/kotlin.Function2.kt similarity index 96% rename from idea/idea-frontend-fir/testData/memberScopeByFqName/kotlin.Function2.txt rename to idea/idea-frontend-fir/testData/memberScopeByFqName/kotlin.Function2.kt index f1084d4b380..936e7c0a1d8 100644 --- a/idea/idea-frontend-fir/testData/memberScopeByFqName/kotlin.Function2.txt +++ b/idea/idea-frontend-fir/testData/memberScopeByFqName/kotlin.Function2.kt @@ -1,6 +1,9 @@ -class: kotlin/Function2 +// WITH_RUNTIME -// SYMBOLS: +// class: kotlin/Function2 + +// RESULT +/* KtFirFunctionSymbol: annotatedType: [] R annotationClassIds: [] @@ -84,3 +87,4 @@ KtFirFunctionSymbol: typeParameters: [] valueParameters: [] visibility: PUBLIC +*/ diff --git a/idea/idea-frontend-fir/testData/resoreSymbolFromLibrary/class.kt b/idea/idea-frontend-fir/testData/symbols/symbolByFqName/class.kt similarity index 100% rename from idea/idea-frontend-fir/testData/resoreSymbolFromLibrary/class.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByFqName/class.kt diff --git a/idea/idea-frontend-fir/testData/resoreSymbolFromLibrary/classFromJdk.kt b/idea/idea-frontend-fir/testData/symbols/symbolByFqName/classFromJdk.kt similarity index 100% rename from idea/idea-frontend-fir/testData/resoreSymbolFromLibrary/classFromJdk.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByFqName/classFromJdk.kt diff --git a/idea/idea-frontend-fir/testData/resoreSymbolFromLibrary/enumEntry.kt b/idea/idea-frontend-fir/testData/symbols/symbolByFqName/enumEntry.kt similarity index 100% rename from idea/idea-frontend-fir/testData/resoreSymbolFromLibrary/enumEntry.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByFqName/enumEntry.kt diff --git a/idea/idea-frontend-fir/testData/symbolsByFqName/fileWalkDirectionEnum.txt b/idea/idea-frontend-fir/testData/symbols/symbolByFqName/fileWalkDirectionEnum.kt similarity index 95% rename from idea/idea-frontend-fir/testData/symbolsByFqName/fileWalkDirectionEnum.txt rename to idea/idea-frontend-fir/testData/symbols/symbolByFqName/fileWalkDirectionEnum.kt index 6d86b556205..d7ff42eeef4 100644 --- a/idea/idea-frontend-fir/testData/symbolsByFqName/fileWalkDirectionEnum.txt +++ b/idea/idea-frontend-fir/testData/symbols/symbolByFqName/fileWalkDirectionEnum.kt @@ -1,6 +1,9 @@ -callable: kotlin/collections/listOf +// WITH_RUNTIME -// SYMBOLS: +// callable: kotlin/collections/listOf + +// RESULT +/* KtFirFunctionSymbol: annotatedType: [] kotlin/collections/List annotationClassIds: [] @@ -63,3 +66,4 @@ KtFirFunctionSymbol: typeParameters: [KtFirTypeParameterSymbol(T)] valueParameters: [KtFirFunctionValueParameterSymbol(elements)] visibility: PUBLIC +*/ diff --git a/idea/idea-frontend-fir/testData/symbolsByFqName/iterator.txt b/idea/idea-frontend-fir/testData/symbols/symbolByFqName/iterator.kt similarity index 96% rename from idea/idea-frontend-fir/testData/symbolsByFqName/iterator.txt rename to idea/idea-frontend-fir/testData/symbols/symbolByFqName/iterator.kt index 4c83052a7fd..882d2b31deb 100644 --- a/idea/idea-frontend-fir/testData/symbolsByFqName/iterator.txt +++ b/idea/idea-frontend-fir/testData/symbols/symbolByFqName/iterator.kt @@ -1,6 +1,7 @@ class: kotlin/collections/Iterator -// SYMBOLS: +// RESULT +/* KtFirNamedClassOrObjectSymbol: annotationClassIds: [] annotations: [] @@ -19,3 +20,4 @@ KtFirNamedClassOrObjectSymbol: symbolKind: TOP_LEVEL typeParameters: [KtFirTypeParameterSymbol(T)] visibility: PUBLIC +*/ diff --git a/idea/idea-frontend-fir/testData/symbolsByFqName/listOf.txt b/idea/idea-frontend-fir/testData/symbols/symbolByFqName/listOf.kt similarity index 86% rename from idea/idea-frontend-fir/testData/symbolsByFqName/listOf.txt rename to idea/idea-frontend-fir/testData/symbols/symbolByFqName/listOf.kt index f33d43699e4..715c76aee92 100644 --- a/idea/idea-frontend-fir/testData/symbolsByFqName/listOf.txt +++ b/idea/idea-frontend-fir/testData/symbols/symbolByFqName/listOf.kt @@ -1,6 +1,9 @@ -class: kotlin/io/FileWalkDirection +// WITH_RUNTIME -// SYMBOLS: +// class: kotlin/io/FileWalkDirection + +// RESULT +/* KtFirNamedClassOrObjectSymbol: annotationClassIds: [] annotations: [] @@ -19,3 +22,4 @@ KtFirNamedClassOrObjectSymbol: symbolKind: TOP_LEVEL typeParameters: [] visibility: PUBLIC +*/ diff --git a/idea/idea-frontend-fir/testData/resoreSymbolFromLibrary/memberFunction.kt b/idea/idea-frontend-fir/testData/symbols/symbolByFqName/memberFunction.kt similarity index 100% rename from idea/idea-frontend-fir/testData/resoreSymbolFromLibrary/memberFunction.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByFqName/memberFunction.kt diff --git a/idea/idea-frontend-fir/testData/resoreSymbolFromLibrary/memberFunctionWithOverloads.kt b/idea/idea-frontend-fir/testData/symbols/symbolByFqName/memberFunctionWithOverloads.kt similarity index 100% rename from idea/idea-frontend-fir/testData/resoreSymbolFromLibrary/memberFunctionWithOverloads.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByFqName/memberFunctionWithOverloads.kt diff --git a/idea/idea-frontend-fir/testData/resoreSymbolFromLibrary/nestedClass.kt b/idea/idea-frontend-fir/testData/symbols/symbolByFqName/nestedClass.kt similarity index 100% rename from idea/idea-frontend-fir/testData/resoreSymbolFromLibrary/nestedClass.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByFqName/nestedClass.kt diff --git a/idea/idea-frontend-fir/testData/symbolsByPsi/annotations.kt b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/annotations.kt similarity index 99% rename from idea/idea-frontend-fir/testData/symbolsByPsi/annotations.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByPsi/annotations.kt index 724de3d7ee8..4e5cfabd62b 100644 --- a/idea/idea-frontend-fir/testData/symbolsByPsi/annotations.kt +++ b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/annotations.kt @@ -9,7 +9,7 @@ class X { } } -// SYMBOLS: +// RESULT /* KtFirFunctionValueParameterSymbol: annotatedType: [] kotlin/String diff --git a/idea/idea-frontend-fir/testData/symbolsByPsi/anonymousObject.kt b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/anonymousObject.kt similarity index 99% rename from idea/idea-frontend-fir/testData/symbolsByPsi/anonymousObject.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByPsi/anonymousObject.kt index 98a626faf38..fe21d745838 100644 --- a/idea/idea-frontend-fir/testData/symbolsByPsi/anonymousObject.kt +++ b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/anonymousObject.kt @@ -7,7 +7,7 @@ class AnonymousContainer { } } -// SYMBOLS: +// RESULT /* KtFirFunctionSymbol: annotatedType: [] kotlin/Unit diff --git a/idea/idea-frontend-fir/testData/symbolPointer/class.kt b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/class.kt similarity index 100% rename from idea/idea-frontend-fir/testData/symbolPointer/class.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByPsi/class.kt diff --git a/idea/idea-frontend-fir/testData/symbolsByPsi/classMembes.kt b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/classMembes.kt similarity index 99% rename from idea/idea-frontend-fir/testData/symbolsByPsi/classMembes.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByPsi/classMembes.kt index 270ed3a0cb7..9a92a9ece12 100644 --- a/idea/idea-frontend-fir/testData/symbolsByPsi/classMembes.kt +++ b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/classMembes.kt @@ -3,7 +3,7 @@ class A { fun x() = 10 } -// SYMBOLS: +// RESULT /* KtFirKotlinPropertySymbol: annotatedType: [] kotlin/Int diff --git a/idea/idea-frontend-fir/testData/symbolPointer/classPrimaryConstructor.kt b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/classPrimaryConstructor.kt similarity index 100% rename from idea/idea-frontend-fir/testData/symbolPointer/classPrimaryConstructor.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByPsi/classPrimaryConstructor.kt diff --git a/idea/idea-frontend-fir/testData/symbolPointer/classSecondaryConstructors.kt b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/classSecondaryConstructors.kt similarity index 100% rename from idea/idea-frontend-fir/testData/symbolPointer/classSecondaryConstructors.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByPsi/classSecondaryConstructors.kt diff --git a/idea/idea-frontend-fir/testData/symbolsByPsi/classWithTypeParams.kt b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/classWithTypeParams.kt similarity index 98% rename from idea/idea-frontend-fir/testData/symbolsByPsi/classWithTypeParams.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByPsi/classWithTypeParams.kt index f6ab674e702..dab7b67e5e8 100644 --- a/idea/idea-frontend-fir/testData/symbolsByPsi/classWithTypeParams.kt +++ b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/classWithTypeParams.kt @@ -1,7 +1,7 @@ class A { } -// SYMBOLS: +// RESULT /* KtFirTypeParameterSymbol: isReified: false diff --git a/idea/idea-frontend-fir/testData/symbolPointer/enum.kt b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/enum.kt similarity index 100% rename from idea/idea-frontend-fir/testData/symbolPointer/enum.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByPsi/enum.kt diff --git a/idea/idea-frontend-fir/testData/symbolsByPsi/extensionFunction.kt b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/extensionFunction.kt similarity index 97% rename from idea/idea-frontend-fir/testData/symbolsByPsi/extensionFunction.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByPsi/extensionFunction.kt index 2a45d83940f..254472e2c60 100644 --- a/idea/idea-frontend-fir/testData/symbolsByPsi/extensionFunction.kt +++ b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/extensionFunction.kt @@ -1,6 +1,6 @@ fun String.foo(): Int = 10 -// SYMBOLS: +// RESULT /* KtFirFunctionSymbol: annotatedType: [] kotlin/Int diff --git a/idea/idea-frontend-fir/testData/symbolsByPsi/function.kt b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/function.kt similarity index 98% rename from idea/idea-frontend-fir/testData/symbolsByPsi/function.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByPsi/function.kt index 2022cb53001..26709ad663f 100644 --- a/idea/idea-frontend-fir/testData/symbolsByPsi/function.kt +++ b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/function.kt @@ -1,6 +1,6 @@ fun foo(x: Int) {} -// SYMBOLS: +// RESULT /* KtFirFunctionValueParameterSymbol: annotatedType: [] kotlin/Int diff --git a/idea/idea-frontend-fir/testData/symbolsByPsi/functionWithTypeParams.kt b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/functionWithTypeParams.kt similarity index 98% rename from idea/idea-frontend-fir/testData/symbolsByPsi/functionWithTypeParams.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByPsi/functionWithTypeParams.kt index 9e1457bd5ef..0b4ffac76ca 100644 --- a/idea/idea-frontend-fir/testData/symbolsByPsi/functionWithTypeParams.kt +++ b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/functionWithTypeParams.kt @@ -1,6 +1,6 @@ fun foo(x: X) {} -// SYMBOLS: +// RESULT /* KtFirTypeParameterSymbol: isReified: false diff --git a/idea/idea-frontend-fir/testData/symbolsByPsi/implicitReturn.kt b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/implicitReturn.kt similarity index 97% rename from idea/idea-frontend-fir/testData/symbolsByPsi/implicitReturn.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByPsi/implicitReturn.kt index 919b7873366..68573502635 100644 --- a/idea/idea-frontend-fir/testData/symbolsByPsi/implicitReturn.kt +++ b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/implicitReturn.kt @@ -1,6 +1,6 @@ fun foo(): Int = 10 -// SYMBOLS: +// RESULT /* KtFirFunctionSymbol: annotatedType: [] kotlin/Int diff --git a/idea/idea-frontend-fir/testData/symbolsByPsi/localDeclarations.kt b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/localDeclarations.kt similarity index 99% rename from idea/idea-frontend-fir/testData/symbolsByPsi/localDeclarations.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByPsi/localDeclarations.kt index b766e41011c..fc252e3b259 100644 --- a/idea/idea-frontend-fir/testData/symbolsByPsi/localDeclarations.kt +++ b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/localDeclarations.kt @@ -5,7 +5,7 @@ fun yyy() { class F {} } -// SYMBOLS: +// RESULT /* KtFirLocalVariableSymbol: annotatedType: [] kotlin/Int diff --git a/idea/idea-frontend-fir/testData/symbolPointer/memberFunctions.kt b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/memberFunctions.kt similarity index 100% rename from idea/idea-frontend-fir/testData/symbolPointer/memberFunctions.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByPsi/memberFunctions.kt diff --git a/idea/idea-frontend-fir/testData/symbolPointer/memberProperties.kt b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/memberProperties.kt similarity index 100% rename from idea/idea-frontend-fir/testData/symbolPointer/memberProperties.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByPsi/memberProperties.kt diff --git a/idea/idea-frontend-fir/testData/symbolPointer/topLevelFunctions.kt b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/topLevelFunctions.kt similarity index 100% rename from idea/idea-frontend-fir/testData/symbolPointer/topLevelFunctions.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByPsi/topLevelFunctions.kt diff --git a/idea/idea-frontend-fir/testData/symbolPointer/topLevelProperties.kt b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/topLevelProperties.kt similarity index 100% rename from idea/idea-frontend-fir/testData/symbolPointer/topLevelProperties.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByPsi/topLevelProperties.kt diff --git a/idea/idea-frontend-fir/testData/symbolsByPsi/typeAnnotations.kt b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/typeAnnotations.kt similarity index 99% rename from idea/idea-frontend-fir/testData/symbolsByPsi/typeAnnotations.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByPsi/typeAnnotations.kt index be2a76d8f2c..3f990865156 100644 --- a/idea/idea-frontend-fir/testData/symbolsByPsi/typeAnnotations.kt +++ b/idea/idea-frontend-fir/testData/symbols/symbolByPsi/typeAnnotations.kt @@ -15,7 +15,7 @@ class X : @Anno1 I { val x: @Anno4 I = this } -// SYMBOLS: +// RESULT /* KtFirNamedClassOrObjectSymbol: annotationClassIds: [kotlin/annotation/Target] diff --git a/idea/idea-frontend-fir/testData/symbolByReference/accessorField.kt b/idea/idea-frontend-fir/testData/symbols/symbolByReference/accessorField.kt similarity index 100% rename from idea/idea-frontend-fir/testData/symbolByReference/accessorField.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByReference/accessorField.kt diff --git a/idea/idea-frontend-fir/testData/symbolByReference/constructorViaTypeAlias.kt b/idea/idea-frontend-fir/testData/symbols/symbolByReference/constructorViaTypeAlias.kt similarity index 93% rename from idea/idea-frontend-fir/testData/symbolByReference/constructorViaTypeAlias.kt rename to idea/idea-frontend-fir/testData/symbols/symbolByReference/constructorViaTypeAlias.kt index 071a76770ca..ff768f124e6 100644 --- a/idea/idea-frontend-fir/testData/symbolByReference/constructorViaTypeAlias.kt +++ b/idea/idea-frontend-fir/testData/symbols/symbolByReference/constructorViaTypeAlias.kt @@ -1,4 +1,5 @@ // WITH_RUNTIME +// DO_NOT_CHECK_SYMBOL_RESTORE fun x() { val a = ArrayList(listOf(1)) diff --git a/idea/idea-frontend-fir/testData/symbolsByPsi/class.kt b/idea/idea-frontend-fir/testData/symbolsByPsi/class.kt deleted file mode 100644 index 13a3394fb69..00000000000 --- a/idea/idea-frontend-fir/testData/symbolsByPsi/class.kt +++ /dev/null @@ -1,24 +0,0 @@ -class A { -} - -// SYMBOLS: -/* -KtFirNamedClassOrObjectSymbol: - annotationClassIds: [] - annotations: [] - classIdIfNonLocal: A - classKind: CLASS - companionObject: null - isData: false - isExternal: false - isFun: false - isInline: false - isInner: false - modality: FINAL - name: A - origin: SOURCE - superTypes: [[] kotlin/Any] - symbolKind: TOP_LEVEL - typeParameters: [] - visibility: PUBLIC -*/ diff --git a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/scopes/AbstractMemberScopeTest.kt b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/scopes/AbstractMemberScopeTest.kt index 8de8690fe0b..45e978c2ef5 100644 --- a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/scopes/AbstractMemberScopeTest.kt +++ b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/scopes/AbstractMemberScopeTest.kt @@ -6,15 +6,18 @@ package org.jetbrains.kotlin.idea.frontend.api.scopes import org.jetbrains.kotlin.idea.frontend.api.KtAnalysisSession -import org.jetbrains.kotlin.idea.frontend.api.SymbolData -import org.jetbrains.kotlin.idea.frontend.api.symbols.AbstractSymbolsByFqNameBuildingTest +import org.jetbrains.kotlin.idea.frontend.api.SymbolByFqName +import org.jetbrains.kotlin.idea.frontend.api.symbols.AbstractSymbolByFqNameTest import org.jetbrains.kotlin.idea.frontend.api.symbols.KtClassOrObjectSymbol import org.jetbrains.kotlin.idea.frontend.api.symbols.KtSymbol +import org.jetbrains.kotlin.idea.test.framework.TestFileStructure -abstract class AbstractMemberScopeByFqNameTest : AbstractSymbolsByFqNameBuildingTest() { - override fun KtAnalysisSession.createSymbols(symbolData: SymbolData): List { +abstract class AbstractMemberScopeByFqNameTest : AbstractSymbolByFqNameTest() { + override fun KtAnalysisSession.collectSymbols(fileStructure: TestFileStructure): List { + val symbolData = SymbolByFqName.getSymbolDataFromFile(fileStructure.filePath) val symbols = with(symbolData) { toSymbols() } - val classSymbol = symbols.singleOrNull() as? KtClassOrObjectSymbol ?: error("Should be a single class symbol, but $symbols found") + val classSymbol = symbols.singleOrNull() as? KtClassOrObjectSymbol + ?: error("Should be a single class symbol, but $symbols found") return classSymbol.getMemberScope().getAllSymbols().toList() } } \ No newline at end of file diff --git a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/scopes/MemberScopeByFqNameTestGenerated.java b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/scopes/MemberScopeByFqNameTestGenerated.java index 6838f1c779b..786a473b7fe 100644 --- a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/scopes/MemberScopeByFqNameTestGenerated.java +++ b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/scopes/MemberScopeByFqNameTestGenerated.java @@ -26,26 +26,26 @@ public class MemberScopeByFqNameTestGenerated extends AbstractMemberScopeByFqNam } public void testAllFilesPresentInMemberScopeByFqName() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/idea-frontend-fir/testData/memberScopeByFqName"), Pattern.compile("^(.+)\\.txt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/idea-frontend-fir/testData/memberScopeByFqName"), Pattern.compile("^(.+)\\.kt$"), null, true); } - @TestMetadata("Int.txt") + @TestMetadata("Int.kt") public void testInt() throws Exception { - runTest("idea/idea-frontend-fir/testData/memberScopeByFqName/Int.txt"); + runTest("idea/idea-frontend-fir/testData/memberScopeByFqName/Int.kt"); } - @TestMetadata("java.lang.String.txt") + @TestMetadata("java.lang.String.kt") public void testJava_lang_String() throws Exception { - runTest("idea/idea-frontend-fir/testData/memberScopeByFqName/java.lang.String.txt"); + runTest("idea/idea-frontend-fir/testData/memberScopeByFqName/java.lang.String.kt"); } - @TestMetadata("kotlin.Function2.txt") + @TestMetadata("kotlin.Function2.kt") public void testKotlin_Function2() throws Exception { - runTest("idea/idea-frontend-fir/testData/memberScopeByFqName/kotlin.Function2.txt"); + runTest("idea/idea-frontend-fir/testData/memberScopeByFqName/kotlin.Function2.kt"); } - @TestMetadata("MutableList.txt") + @TestMetadata("MutableList.kt") public void testMutableList() throws Exception { - runTest("idea/idea-frontend-fir/testData/memberScopeByFqName/MutableList.txt"); + runTest("idea/idea-frontend-fir/testData/memberScopeByFqName/MutableList.kt"); } } diff --git a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolFromLibraryPointerRestoreTest.kt b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolByFqNameTest.kt similarity index 83% rename from idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolFromLibraryPointerRestoreTest.kt rename to idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolByFqNameTest.kt index b09356e3673..d98ffa1968a 100644 --- a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolFromLibraryPointerRestoreTest.kt +++ b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolByFqNameTest.kt @@ -8,9 +8,8 @@ package org.jetbrains.kotlin.idea.frontend.api.symbols import org.jetbrains.kotlin.idea.frontend.api.KtAnalysisSession import org.jetbrains.kotlin.idea.frontend.api.SymbolByFqName import org.jetbrains.kotlin.idea.test.framework.TestFileStructure -import org.jetbrains.kotlin.psi.KtFile -abstract class AbstractSymbolFromLibraryPointerRestoreTest : AbstractSymbolPointerRestoreTest() { +abstract class AbstractSymbolByFqNameTest : AbstractSymbolTest() { override fun KtAnalysisSession.collectSymbols(fileStructure: TestFileStructure): List { val symbolData = SymbolByFqName.getSymbolDataFromFile(fileStructure.filePath) return with(symbolData) { toSymbols() } diff --git a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolFromSourcePointerRestoreTest.kt b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolByPsiTest.kt similarity index 84% rename from idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolFromSourcePointerRestoreTest.kt rename to idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolByPsiTest.kt index 0cae2839aa1..0dac23fe501 100644 --- a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolFromSourcePointerRestoreTest.kt +++ b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolByPsiTest.kt @@ -8,10 +8,9 @@ package org.jetbrains.kotlin.idea.frontend.api.symbols import org.jetbrains.kotlin.idea.frontend.api.KtAnalysisSession import org.jetbrains.kotlin.idea.test.framework.TestFileStructure import org.jetbrains.kotlin.psi.KtDeclaration -import org.jetbrains.kotlin.psi.KtFile import org.jetbrains.kotlin.psi.psiUtil.collectDescendantsOfType -abstract class AbstractSymbolFromSourcePointerRestoreTest : AbstractSymbolPointerRestoreTest() { +abstract class AbstractSymbolByPsiTest : AbstractSymbolTest() { override fun KtAnalysisSession.collectSymbols(fileStructure: TestFileStructure): List = fileStructure.mainKtFile.collectDescendantsOfType().map { declaration -> declaration.getSymbol() diff --git a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolByReferencePointerRestoreTest.kt b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolByReferencePointerRestoreTest.kt deleted file mode 100644 index a9aaedcfe89..00000000000 --- a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolByReferencePointerRestoreTest.kt +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.idea.frontend.api.symbols - -import org.jetbrains.kotlin.idea.frontend.api.KtAnalysisSession -import org.jetbrains.kotlin.idea.references.mainReference -import org.jetbrains.kotlin.idea.test.framework.TestFileStructure -import org.jetbrains.kotlin.psi.KtNameReferenceExpression - -abstract class AbstractSymbolByReferencePointerRestoreTest : AbstractSymbolPointerRestoreTest() { - override fun KtAnalysisSession.collectSymbols(fileStructure: TestFileStructure): List { - val referenceExpression = getElementOfTypeAtCaret() - return listOfNotNull(referenceExpression.mainReference.resolveToSymbol()) - } -} \ No newline at end of file diff --git a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolByReferenceTest.kt b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolByReferenceTest.kt index eb17689979e..1ad646ddbde 100644 --- a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolByReferenceTest.kt +++ b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolByReferenceTest.kt @@ -1,35 +1,18 @@ /* - * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.idea.frontend.api.symbols -import org.jetbrains.kotlin.idea.analyseOnPooledThreadInReadAction -import org.jetbrains.kotlin.idea.references.KtSimpleNameReference +import org.jetbrains.kotlin.idea.frontend.api.KtAnalysisSession import org.jetbrains.kotlin.idea.references.mainReference -import org.jetbrains.kotlin.idea.test.framework.AbstractKtIdeaTest import org.jetbrains.kotlin.idea.test.framework.TestFileStructure -import org.jetbrains.kotlin.idea.test.framework.TestStructureExpectedDataBlock -import org.jetbrains.kotlin.idea.test.framework.TestStructureRenderer import org.jetbrains.kotlin.psi.KtNameReferenceExpression -import org.jetbrains.kotlin.test.KotlinTestUtils -abstract class AbstractSymbolByReferenceTest : AbstractKtIdeaTest() { - override fun doTestByFileStructure(fileStructure: TestFileStructure) { +abstract class AbstractSymbolByReferenceTest : AbstractSymbolTest() { + override fun KtAnalysisSession.collectSymbols(fileStructure: TestFileStructure): List { val referenceExpression = getElementOfTypeAtCaret() - val reference = referenceExpression.mainReference - val renderedSymbol = analyseOnPooledThreadInReadAction(fileStructure.mainKtFile) { - val symbol = reference.resolveToSymbol() - ?: error("${referenceExpression.text} was not resolved to anything") - DebugSymbolRenderer.render(symbol) - } - - val actual = TestStructureRenderer.render( - fileStructure, - TestStructureExpectedDataBlock(renderedSymbol), - renderingMode = TestStructureRenderer.RenderingMode.ALL_BLOCKS_IN_MULTI_LINE_COMMENT, - ) - KotlinTestUtils.assertEqualsToFile(fileStructure.filePath.toFile(), actual) + return listOfNotNull(referenceExpression.mainReference.resolveToSymbol()) } } \ No newline at end of file diff --git a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolPointerRestoreTest.kt b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolTest.kt similarity index 76% rename from idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolPointerRestoreTest.kt rename to idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolTest.kt index d77aabfbe33..72a1cdeefe3 100644 --- a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolPointerRestoreTest.kt +++ b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolTest.kt @@ -12,27 +12,40 @@ import com.intellij.psi.PsiDocumentManager import org.jetbrains.kotlin.idea.analyseOnPooledThreadInReadAction import org.jetbrains.kotlin.idea.frontend.api.KtAnalysisSession import org.jetbrains.kotlin.idea.frontend.api.symbols.pointers.KtSymbolPointer -import org.jetbrains.kotlin.idea.test.framework.AbstractKtIdeaTest -import org.jetbrains.kotlin.idea.test.framework.TestFileStructure -import org.jetbrains.kotlin.idea.test.framework.TestStructureExpectedDataBlock -import org.jetbrains.kotlin.idea.test.framework.TestStructureRenderer +import org.jetbrains.kotlin.idea.test.framework.* import org.jetbrains.kotlin.psi.KtFile import org.jetbrains.kotlin.psi.KtPsiFactory import org.jetbrains.kotlin.test.KotlinTestUtils -abstract class AbstractSymbolPointerRestoreTest : AbstractKtIdeaTest() { +abstract class AbstractSymbolTest : AbstractKtIdeaTest() { abstract fun KtAnalysisSession.collectSymbols(fileStructure: TestFileStructure): List + override val allowedDirectives: List> = listOf(DIRECTIVES.DO_NOT_CHECK_SYMBOL_RESTORE) + override fun doTestByFileStructure(fileStructure: TestFileStructure) { + val createPointers = !fileStructure.directives.isDirectivePresent(DIRECTIVES.DO_NOT_CHECK_SYMBOL_RESTORE) val pointersWithRendered = analyseOnPooledThreadInReadAction(fileStructure.mainKtFile) { collectSymbols(fileStructure).map { symbol -> PointerWithRenderedSymbol( - symbol.createPointer(), + if (createPointers) symbol.createPointer() else null, DebugSymbolRenderer.render(symbol) ) } } + compareResults(fileStructure, pointersWithRendered) + + doOutOfBlockModification(fileStructure.mainKtFile) + + if (createPointers) { + restoreSymbolsInOtherReadActionAndCompareResults(fileStructure, pointersWithRendered) + } + } + + private fun compareResults( + fileStructure: TestFileStructure, + pointersWithRendered: List + ) { val actual = TestStructureRenderer.render( fileStructure, TestStructureExpectedDataBlock(values = pointersWithRendered.map { it.rendered }), @@ -40,10 +53,6 @@ abstract class AbstractSymbolPointerRestoreTest : AbstractKtIdeaTest() { ) KotlinTestUtils.assertEqualsToFile(fileStructure.filePath.toFile(), actual) - - doOutOfBlockModification(fileStructure.mainKtFile) - - restoreSymbolsInOtherReadActionAndCompareResults(fileStructure, pointersWithRendered) } private fun restoreSymbolsInOtherReadActionAndCompareResults( @@ -52,7 +61,8 @@ abstract class AbstractSymbolPointerRestoreTest : AbstractKtIdeaTest() { ) { val restored = analyseOnPooledThreadInReadAction(fileStructure.mainKtFile) { pointersWithRendered.map { (pointer, expectedRender) -> - val restored = pointer.restoreSymbol() ?: error("Symbol $expectedRender was not not restored correctly") + val restored = pointer!!.restoreSymbol() + ?: error("Symbol $expectedRender was not not restored") DebugSymbolRenderer.render(restored) } } @@ -83,6 +93,10 @@ abstract class AbstractSymbolPointerRestoreTest : AbstractKtIdeaTest() { private fun commitDocument(document: Document) { PsiDocumentManager.getInstance(project).commitDocument(document) } + + private object DIRECTIVES { + val DO_NOT_CHECK_SYMBOL_RESTORE = PresenceDirective("// DO_NOT_CHECK_SYMBOL_RESTORE") + } } -private data class PointerWithRenderedSymbol(val pointer: KtSymbolPointer<*>, val rendered: String) \ No newline at end of file +private data class PointerWithRenderedSymbol(val pointer: KtSymbolPointer<*>?, val rendered: String) \ No newline at end of file diff --git a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolsByFqNameBuildingTest.kt b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolsByFqNameBuildingTest.kt deleted file mode 100644 index cfca053bb9d..00000000000 --- a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolsByFqNameBuildingTest.kt +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.idea.frontend.api.symbols - -import org.jetbrains.kotlin.idea.frontend.api.AbstractSymbolByFqNameTest -import org.jetbrains.kotlin.idea.frontend.api.KtAnalysisSession -import org.jetbrains.kotlin.idea.frontend.api.SymbolData - -abstract class AbstractSymbolsByFqNameBuildingTest : AbstractSymbolByFqNameTest() { - override fun KtAnalysisSession.createSymbols(symbolData: SymbolData): List = - with(symbolData) { toSymbols() } -} \ No newline at end of file diff --git a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolsByPsiBuildingTest.kt b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolsByPsiBuildingTest.kt deleted file mode 100644 index 717e0f46ead..00000000000 --- a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/AbstractSymbolsByPsiBuildingTest.kt +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.idea.frontend.api.symbols - -import com.intellij.openapi.util.io.FileUtil -import org.jetbrains.kotlin.idea.addExternalTestFiles -import org.jetbrains.kotlin.idea.executeOnPooledThreadInReadAction -import org.jetbrains.kotlin.idea.frontend.api.analyze -import org.jetbrains.kotlin.idea.frontend.api.fir.KtFirAnalysisSession -import org.jetbrains.kotlin.idea.frontend.api.getAnalysisSessionFor -import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase -import org.jetbrains.kotlin.psi.KtDeclaration -import org.jetbrains.kotlin.psi.KtFile -import org.jetbrains.kotlin.psi.psiUtil.collectDescendantsOfType -import org.jetbrains.kotlin.test.KotlinTestUtils -import java.io.File - -abstract class AbstractSymbolsByPsiBuildingTest : KotlinLightCodeInsightFixtureTestCase() { - protected fun doTest(path: String) { - addExternalTestFiles(path) - val file = File(path) - val ktFile = myFixture.configureByText(file.name, FileUtil.loadFile(file)) as KtFile - - val renderedSymbols = executeOnPooledThreadInReadAction { - analyze(ktFile) { - val declarationSymbols = ktFile.collectDescendantsOfType().map { declaration -> - declaration.getSymbol() - } - declarationSymbols.map(DebugSymbolRenderer::render) - } - } - - val actual = buildString { - val actualSymbolsData = renderedSymbols.joinToString(separator = "\n") - val fileTextWithoutSymbolsData = ktFile.text.substringBeforeLast(SYMBOLS_TAG).trimEnd() - appendLine(fileTextWithoutSymbolsData) - appendLine() - appendLine(SYMBOLS_TAG) - appendLine("/*") - append(actualSymbolsData) - appendLine("*/") - } - KotlinTestUtils.assertEqualsToFile(file, actual) - - } - - companion object { - private const val SYMBOLS_TAG = "// SYMBOLS:" - } -} diff --git a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolFromLibraryPointerRestoreTestGenerated.java b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolByFqNameTestGenerated.java similarity index 52% rename from idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolFromLibraryPointerRestoreTestGenerated.java rename to idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolByFqNameTestGenerated.java index 585f8ef1f45..95bd3b7a94b 100644 --- a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolFromLibraryPointerRestoreTestGenerated.java +++ b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolByFqNameTestGenerated.java @@ -17,45 +17,60 @@ import java.util.regex.Pattern; /** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") -@TestMetadata("idea/idea-frontend-fir/testData/resoreSymbolFromLibrary") +@TestMetadata("idea/idea-frontend-fir/testData/symbols/symbolByFqName") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) -public class SymbolFromLibraryPointerRestoreTestGenerated extends AbstractSymbolFromLibraryPointerRestoreTest { +public class SymbolByFqNameTestGenerated extends AbstractSymbolByFqNameTest { private void runTest(String testDataFilePath) throws Exception { KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); } - public void testAllFilesPresentInResoreSymbolFromLibrary() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/idea-frontend-fir/testData/resoreSymbolFromLibrary"), Pattern.compile("^(.+)\\.kt$"), null, true); + public void testAllFilesPresentInSymbolByFqName() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/idea-frontend-fir/testData/symbols/symbolByFqName"), Pattern.compile("^(.+)\\.kt$"), null, true); } @TestMetadata("class.kt") public void testClass() throws Exception { - runTest("idea/idea-frontend-fir/testData/resoreSymbolFromLibrary/class.kt"); + runTest("idea/idea-frontend-fir/testData/symbols/symbolByFqName/class.kt"); } @TestMetadata("classFromJdk.kt") public void testClassFromJdk() throws Exception { - runTest("idea/idea-frontend-fir/testData/resoreSymbolFromLibrary/classFromJdk.kt"); + runTest("idea/idea-frontend-fir/testData/symbols/symbolByFqName/classFromJdk.kt"); } @TestMetadata("enumEntry.kt") public void testEnumEntry() throws Exception { - runTest("idea/idea-frontend-fir/testData/resoreSymbolFromLibrary/enumEntry.kt"); + runTest("idea/idea-frontend-fir/testData/symbols/symbolByFqName/enumEntry.kt"); + } + + @TestMetadata("fileWalkDirectionEnum.kt") + public void testFileWalkDirectionEnum() throws Exception { + runTest("idea/idea-frontend-fir/testData/symbols/symbolByFqName/fileWalkDirectionEnum.kt"); + } + + @TestMetadata("iterator.kt") + public void testIterator() throws Exception { + runTest("idea/idea-frontend-fir/testData/symbols/symbolByFqName/iterator.kt"); + } + + @TestMetadata("listOf.kt") + public void testListOf() throws Exception { + runTest("idea/idea-frontend-fir/testData/symbols/symbolByFqName/listOf.kt"); } @TestMetadata("memberFunction.kt") public void testMemberFunction() throws Exception { - runTest("idea/idea-frontend-fir/testData/resoreSymbolFromLibrary/memberFunction.kt"); + runTest("idea/idea-frontend-fir/testData/symbols/symbolByFqName/memberFunction.kt"); } @TestMetadata("memberFunctionWithOverloads.kt") public void testMemberFunctionWithOverloads() throws Exception { - runTest("idea/idea-frontend-fir/testData/resoreSymbolFromLibrary/memberFunctionWithOverloads.kt"); + runTest("idea/idea-frontend-fir/testData/symbols/symbolByFqName/memberFunctionWithOverloads.kt"); } @TestMetadata("nestedClass.kt") public void testNestedClass() throws Exception { - runTest("idea/idea-frontend-fir/testData/resoreSymbolFromLibrary/nestedClass.kt"); + runTest("idea/idea-frontend-fir/testData/symbols/symbolByFqName/nestedClass.kt"); } } diff --git a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolByPsiTestGenerated.java b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolByPsiTestGenerated.java new file mode 100644 index 00000000000..28062ee6b45 --- /dev/null +++ b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolByPsiTestGenerated.java @@ -0,0 +1,121 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.frontend.api.symbols; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; +import org.jetbrains.kotlin.test.KotlinTestUtils; +import org.jetbrains.kotlin.test.util.KtTestUtil; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.runner.RunWith; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("idea/idea-frontend-fir/testData/symbols/symbolByPsi") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class SymbolByPsiTestGenerated extends AbstractSymbolByPsiTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInSymbolByPsi() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/idea-frontend-fir/testData/symbols/symbolByPsi"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @TestMetadata("annotations.kt") + public void testAnnotations() throws Exception { + runTest("idea/idea-frontend-fir/testData/symbols/symbolByPsi/annotations.kt"); + } + + @TestMetadata("anonymousObject.kt") + public void testAnonymousObject() throws Exception { + runTest("idea/idea-frontend-fir/testData/symbols/symbolByPsi/anonymousObject.kt"); + } + + @TestMetadata("class.kt") + public void testClass() throws Exception { + runTest("idea/idea-frontend-fir/testData/symbols/symbolByPsi/class.kt"); + } + + @TestMetadata("classMembes.kt") + public void testClassMembes() throws Exception { + runTest("idea/idea-frontend-fir/testData/symbols/symbolByPsi/classMembes.kt"); + } + + @TestMetadata("classPrimaryConstructor.kt") + public void testClassPrimaryConstructor() throws Exception { + runTest("idea/idea-frontend-fir/testData/symbols/symbolByPsi/classPrimaryConstructor.kt"); + } + + @TestMetadata("classSecondaryConstructors.kt") + public void testClassSecondaryConstructors() throws Exception { + runTest("idea/idea-frontend-fir/testData/symbols/symbolByPsi/classSecondaryConstructors.kt"); + } + + @TestMetadata("classWithTypeParams.kt") + public void testClassWithTypeParams() throws Exception { + runTest("idea/idea-frontend-fir/testData/symbols/symbolByPsi/classWithTypeParams.kt"); + } + + @TestMetadata("enum.kt") + public void testEnum() throws Exception { + runTest("idea/idea-frontend-fir/testData/symbols/symbolByPsi/enum.kt"); + } + + @TestMetadata("extensionFunction.kt") + public void testExtensionFunction() throws Exception { + runTest("idea/idea-frontend-fir/testData/symbols/symbolByPsi/extensionFunction.kt"); + } + + @TestMetadata("function.kt") + public void testFunction() throws Exception { + runTest("idea/idea-frontend-fir/testData/symbols/symbolByPsi/function.kt"); + } + + @TestMetadata("functionWithTypeParams.kt") + public void testFunctionWithTypeParams() throws Exception { + runTest("idea/idea-frontend-fir/testData/symbols/symbolByPsi/functionWithTypeParams.kt"); + } + + @TestMetadata("implicitReturn.kt") + public void testImplicitReturn() throws Exception { + runTest("idea/idea-frontend-fir/testData/symbols/symbolByPsi/implicitReturn.kt"); + } + + @TestMetadata("localDeclarations.kt") + public void testLocalDeclarations() throws Exception { + runTest("idea/idea-frontend-fir/testData/symbols/symbolByPsi/localDeclarations.kt"); + } + + @TestMetadata("memberFunctions.kt") + public void testMemberFunctions() throws Exception { + runTest("idea/idea-frontend-fir/testData/symbols/symbolByPsi/memberFunctions.kt"); + } + + @TestMetadata("memberProperties.kt") + public void testMemberProperties() throws Exception { + runTest("idea/idea-frontend-fir/testData/symbols/symbolByPsi/memberProperties.kt"); + } + + @TestMetadata("topLevelFunctions.kt") + public void testTopLevelFunctions() throws Exception { + runTest("idea/idea-frontend-fir/testData/symbols/symbolByPsi/topLevelFunctions.kt"); + } + + @TestMetadata("topLevelProperties.kt") + public void testTopLevelProperties() throws Exception { + runTest("idea/idea-frontend-fir/testData/symbols/symbolByPsi/topLevelProperties.kt"); + } + + @TestMetadata("typeAnnotations.kt") + public void testTypeAnnotations() throws Exception { + runTest("idea/idea-frontend-fir/testData/symbols/symbolByPsi/typeAnnotations.kt"); + } +} diff --git a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolByReferencePointerRestoreTestGenerated.java b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolByReferencePointerRestoreTestGenerated.java deleted file mode 100644 index 3a727beb6c0..00000000000 --- a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolByReferencePointerRestoreTestGenerated.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.idea.frontend.api.symbols; - -import com.intellij.testFramework.TestDataPath; -import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; -import org.jetbrains.kotlin.test.KotlinTestUtils; -import org.jetbrains.kotlin.test.util.KtTestUtil; -import org.jetbrains.kotlin.test.TestMetadata; -import org.junit.runner.RunWith; - -import java.io.File; -import java.util.regex.Pattern; - -/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ -@SuppressWarnings("all") -@TestMetadata("idea/idea-frontend-fir/testData/symbolByReference") -@TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) -public class SymbolByReferencePointerRestoreTestGenerated extends AbstractSymbolByReferencePointerRestoreTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - @TestMetadata("accessorField.kt") - public void testAccessorField() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolByReference/accessorField.kt"); - } - - public void testAllFilesPresentInSymbolByReference() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/idea-frontend-fir/testData/symbolByReference"), Pattern.compile("^(.+)\\.kt$"), null, true); - } - - @TestMetadata("constructorViaTypeAlias.kt") - public void testConstructorViaTypeAlias() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolByReference/constructorViaTypeAlias.kt"); - } -} diff --git a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolByReferenceTestGenerated.java b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolByReferenceTestGenerated.java index cca6feb9e38..ba63423804f 100644 --- a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolByReferenceTestGenerated.java +++ b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolByReferenceTestGenerated.java @@ -17,7 +17,7 @@ import java.util.regex.Pattern; /** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") -@TestMetadata("idea/idea-frontend-fir/testData/symbolByReference") +@TestMetadata("idea/idea-frontend-fir/testData/symbols/symbolByReference") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public class SymbolByReferenceTestGenerated extends AbstractSymbolByReferenceTest { @@ -27,15 +27,15 @@ public class SymbolByReferenceTestGenerated extends AbstractSymbolByReferenceTes @TestMetadata("accessorField.kt") public void testAccessorField() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolByReference/accessorField.kt"); + runTest("idea/idea-frontend-fir/testData/symbols/symbolByReference/accessorField.kt"); } public void testAllFilesPresentInSymbolByReference() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/idea-frontend-fir/testData/symbolByReference"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/idea-frontend-fir/testData/symbols/symbolByReference"), Pattern.compile("^(.+)\\.kt$"), null, true); } @TestMetadata("constructorViaTypeAlias.kt") public void testConstructorViaTypeAlias() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolByReference/constructorViaTypeAlias.kt"); + runTest("idea/idea-frontend-fir/testData/symbols/symbolByReference/constructorViaTypeAlias.kt"); } } diff --git a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolFromSourcePointerRestoreTestGenerated.java b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolFromSourcePointerRestoreTestGenerated.java deleted file mode 100644 index eda8d9b23bb..00000000000 --- a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolFromSourcePointerRestoreTestGenerated.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.idea.frontend.api.symbols; - -import com.intellij.testFramework.TestDataPath; -import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; -import org.jetbrains.kotlin.test.KotlinTestUtils; -import org.jetbrains.kotlin.test.util.KtTestUtil; -import org.jetbrains.kotlin.test.TestMetadata; -import org.junit.runner.RunWith; - -import java.io.File; -import java.util.regex.Pattern; - -/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ -@SuppressWarnings("all") -@TestMetadata("idea/idea-frontend-fir/testData/symbolPointer") -@TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) -public class SymbolFromSourcePointerRestoreTestGenerated extends AbstractSymbolFromSourcePointerRestoreTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInSymbolPointer() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/idea-frontend-fir/testData/symbolPointer"), Pattern.compile("^(.+)\\.kt$"), null, true); - } - - @TestMetadata("class.kt") - public void testClass() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolPointer/class.kt"); - } - - @TestMetadata("classPrimaryConstructor.kt") - public void testClassPrimaryConstructor() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolPointer/classPrimaryConstructor.kt"); - } - - @TestMetadata("classSecondaryConstructors.kt") - public void testClassSecondaryConstructors() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolPointer/classSecondaryConstructors.kt"); - } - - @TestMetadata("enum.kt") - public void testEnum() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolPointer/enum.kt"); - } - - @TestMetadata("memberFunctions.kt") - public void testMemberFunctions() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolPointer/memberFunctions.kt"); - } - - @TestMetadata("memberProperties.kt") - public void testMemberProperties() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolPointer/memberProperties.kt"); - } - - @TestMetadata("topLevelFunctions.kt") - public void testTopLevelFunctions() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolPointer/topLevelFunctions.kt"); - } - - @TestMetadata("topLevelProperties.kt") - public void testTopLevelProperties() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolPointer/topLevelProperties.kt"); - } -} diff --git a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolsByFqNameBuildingTestGenerated.java b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolsByFqNameBuildingTestGenerated.java deleted file mode 100644 index eeb8c721a65..00000000000 --- a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolsByFqNameBuildingTestGenerated.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.idea.frontend.api.symbols; - -import com.intellij.testFramework.TestDataPath; -import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; -import org.jetbrains.kotlin.test.KotlinTestUtils; -import org.jetbrains.kotlin.test.util.KtTestUtil; -import org.jetbrains.kotlin.test.TestMetadata; -import org.junit.runner.RunWith; - -import java.io.File; -import java.util.regex.Pattern; - -/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ -@SuppressWarnings("all") -@TestMetadata("idea/idea-frontend-fir/testData/symbolsByFqName") -@TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) -public class SymbolsByFqNameBuildingTestGenerated extends AbstractSymbolsByFqNameBuildingTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInSymbolsByFqName() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/idea-frontend-fir/testData/symbolsByFqName"), Pattern.compile("^(.+)\\.txt$"), null, true); - } - - @TestMetadata("fileWalkDirectionEnum.txt") - public void testFileWalkDirectionEnum() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolsByFqName/fileWalkDirectionEnum.txt"); - } - - @TestMetadata("iterator.txt") - public void testIterator() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolsByFqName/iterator.txt"); - } - - @TestMetadata("listOf.txt") - public void testListOf() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolsByFqName/listOf.txt"); - } -} diff --git a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolsByPsiBuildingTestGenerated.java b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolsByPsiBuildingTestGenerated.java deleted file mode 100644 index dead8b60eb5..00000000000 --- a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/SymbolsByPsiBuildingTestGenerated.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.idea.frontend.api.symbols; - -import com.intellij.testFramework.TestDataPath; -import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; -import org.jetbrains.kotlin.test.KotlinTestUtils; -import org.jetbrains.kotlin.test.util.KtTestUtil; -import org.jetbrains.kotlin.test.TestMetadata; -import org.junit.runner.RunWith; - -import java.io.File; -import java.util.regex.Pattern; - -/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ -@SuppressWarnings("all") -@TestMetadata("idea/idea-frontend-fir/testData/symbolsByPsi") -@TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) -public class SymbolsByPsiBuildingTestGenerated extends AbstractSymbolsByPsiBuildingTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInSymbolsByPsi() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/idea-frontend-fir/testData/symbolsByPsi"), Pattern.compile("^(.+)\\.kt$"), null, true); - } - - @TestMetadata("annotations.kt") - public void testAnnotations() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolsByPsi/annotations.kt"); - } - - @TestMetadata("anonymousObject.kt") - public void testAnonymousObject() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolsByPsi/anonymousObject.kt"); - } - - @TestMetadata("class.kt") - public void testClass() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolsByPsi/class.kt"); - } - - @TestMetadata("classMembes.kt") - public void testClassMembes() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolsByPsi/classMembes.kt"); - } - - @TestMetadata("classWithTypeParams.kt") - public void testClassWithTypeParams() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolsByPsi/classWithTypeParams.kt"); - } - - @TestMetadata("extensionFunction.kt") - public void testExtensionFunction() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolsByPsi/extensionFunction.kt"); - } - - @TestMetadata("function.kt") - public void testFunction() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolsByPsi/function.kt"); - } - - @TestMetadata("functionWithTypeParams.kt") - public void testFunctionWithTypeParams() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolsByPsi/functionWithTypeParams.kt"); - } - - @TestMetadata("implicitReturn.kt") - public void testImplicitReturn() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolsByPsi/implicitReturn.kt"); - } - - @TestMetadata("localDeclarations.kt") - public void testLocalDeclarations() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolsByPsi/localDeclarations.kt"); - } - - @TestMetadata("typeAnnotations.kt") - public void testTypeAnnotations() throws Exception { - runTest("idea/idea-frontend-fir/testData/symbolsByPsi/typeAnnotations.kt"); - } -} diff --git a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/testUtils.kt b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/testUtils.kt deleted file mode 100644 index 62197bc0007..00000000000 --- a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/frontend/api/symbols/testUtils.kt +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.idea.frontend.api.symbols - - diff --git a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/test/framework/TestFileDirective.kt b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/test/framework/TestFileDirective.kt new file mode 100644 index 00000000000..c7db704c623 --- /dev/null +++ b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/test/framework/TestFileDirective.kt @@ -0,0 +1,17 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.test.framework + +import java.util.* + +abstract class TestFileDirective { + abstract val name: String + abstract fun parse(value: String): VALUE? +} + +class PresenceDirective(override val name: String) : TestFileDirective() { + override fun parse(value: String): Boolean = true +} \ No newline at end of file diff --git a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/test/framework/TestFileStructure.kt b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/test/framework/TestFileStructure.kt index be8d2771f67..29cb5f149ff 100644 --- a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/test/framework/TestFileStructure.kt +++ b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/test/framework/TestFileStructure.kt @@ -36,12 +36,11 @@ class TestFileDirectives( @Suppress("UNCHECKED_CAST") return value as VALUE } + + fun isDirectivePresent(directive: PresenceDirective): Boolean = + directive.name in directives } -abstract class TestFileDirective { - abstract val name: String - abstract fun parse(value: String): VALUE? -} sealed class TestFile { abstract val psiFile: PsiFile