diff --git a/generators/frontend-api-generator/tests/org/jetbrains/kotlin/generators/tests/frontend/api/GenerateTests.kt b/generators/frontend-api-generator/tests/org/jetbrains/kotlin/generators/tests/frontend/api/GenerateTests.kt index 03f31ac5dd5..2ec3f51c3e1 100644 --- a/generators/frontend-api-generator/tests/org/jetbrains/kotlin/generators/tests/frontend/api/GenerateTests.kt +++ b/generators/frontend-api-generator/tests/org/jetbrains/kotlin/generators/tests/frontend/api/GenerateTests.kt @@ -57,10 +57,9 @@ fun main(args: Array) { model("symbols/symbolByFqName") } - // todo -// testClass { -// model("symbols/symbolByReference") -// } + testClass { + model("symbols/symbolByReference") + } testClass { model("components/expectedExpressionType") diff --git a/idea/idea-frontend-fir/testData/symbols/symbolByReference/accessorField.kt b/idea/idea-frontend-fir/testData/symbols/symbolByReference/accessorField.kt index 075d9b73ee6..b0cee8d2ce0 100644 --- a/idea/idea-frontend-fir/testData/symbols/symbolByReference/accessorField.kt +++ b/idea/idea-frontend-fir/testData/symbols/symbolByReference/accessorField.kt @@ -3,16 +3,3 @@ var x: Int = 0 set(value) { field = value } - -// RESULT -/* -KtFirBackingFieldSymbol: - annotatedType: [] kotlin/Int - callableIdIfNonLocal: null - isExtension: false - name: field - origin: PROPERTY_BACKING_FIELD - owningProperty: KtFirKotlinPropertySymbol(x) - receiverType: null - symbolKind: LOCAL -*/ diff --git a/idea/idea-frontend-fir/testData/symbols/symbolByReference/accessorField.txt b/idea/idea-frontend-fir/testData/symbols/symbolByReference/accessorField.txt new file mode 100644 index 00000000000..8700e8c7af3 --- /dev/null +++ b/idea/idea-frontend-fir/testData/symbols/symbolByReference/accessorField.txt @@ -0,0 +1,9 @@ +KtFirBackingFieldSymbol: + annotatedType: [] kotlin/Int + callableIdIfNonLocal: null + isExtension: false + name: field + origin: PROPERTY_BACKING_FIELD + owningProperty: KtFirKotlinPropertySymbol(x) + receiverType: null + symbolKind: LOCAL diff --git a/idea/idea-frontend-fir/testData/symbols/symbolByReference/constructorViaTypeAlias.kt b/idea/idea-frontend-fir/testData/symbols/symbolByReference/constructorViaTypeAlias.kt index 0c55d3caf00..a3990c1ef49 100644 --- a/idea/idea-frontend-fir/testData/symbols/symbolByReference/constructorViaTypeAlias.kt +++ b/idea/idea-frontend-fir/testData/symbols/symbolByReference/constructorViaTypeAlias.kt @@ -4,22 +4,3 @@ fun x() { val a = ArrayList(listOf(1)) } - -// RESULT -/* -KtFirConstructorSymbol: - annotatedType: [] java/util/ArrayList - annotationClassIds: [] - annotations: [] - callableIdIfNonLocal: null - containingClassIdIfNonLocal: java/util/ArrayList - dispatchType: java/util/ArrayList - isExtension: false - isPrimary: false - origin: JAVA - receiverType: null - symbolKind: MEMBER - typeParameters: [KtFirTypeParameterSymbol(E)] - valueParameters: [KtFirValueParameterSymbol(c)] - visibility: Public -*/ diff --git a/idea/idea-frontend-fir/testData/symbols/symbolByReference/constructorViaTypeAlias.txt b/idea/idea-frontend-fir/testData/symbols/symbolByReference/constructorViaTypeAlias.txt new file mode 100644 index 00000000000..d4b22f18eaa --- /dev/null +++ b/idea/idea-frontend-fir/testData/symbols/symbolByReference/constructorViaTypeAlias.txt @@ -0,0 +1,16 @@ +KtFirConstructorSymbol: + annotatedType: [] java/util/ArrayList + annotationClassIds: [] + annotations: [] + callableIdIfNonLocal: null + containingClassIdIfNonLocal: java/util/ArrayList + dispatchType: java/util/ArrayList + hasStableParameterNames: false + isExtension: false + isPrimary: false + origin: JAVA + receiverType: null + symbolKind: MEMBER + typeParameters: [KtFirTypeParameterSymbol(E)] + valueParameters: [KtFirValueParameterSymbol(p0)] + visibility: Public diff --git a/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/fir/frontend/api/symbols/SymbolByReferenceTestGenerated.java b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/fir/frontend/api/symbols/SymbolByReferenceTestGenerated.java new file mode 100644 index 00000000000..60afc561b38 --- /dev/null +++ b/idea/idea-frontend-fir/tests/org/jetbrains/kotlin/idea/fir/frontend/api/symbols/SymbolByReferenceTestGenerated.java @@ -0,0 +1,38 @@ +/* + * 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.fir.frontend.api.symbols; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.util.KtTestUtil; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("idea/idea-frontend-fir/testData/symbols/symbolByReference") +@TestDataPath("$PROJECT_ROOT") +public class SymbolByReferenceTestGenerated extends AbstractSymbolByReferenceTest { + @Test + @TestMetadata("accessorField.kt") + public void testAccessorField() throws Exception { + runTest("idea/idea-frontend-fir/testData/symbols/symbolByReference/accessorField.kt"); + } + + @Test + public void testAllFilesPresentInSymbolByReference() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/idea-frontend-fir/testData/symbols/symbolByReference"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("constructorViaTypeAlias.kt") + public void testConstructorViaTypeAlias() throws Exception { + runTest("idea/idea-frontend-fir/testData/symbols/symbolByReference/constructorViaTypeAlias.kt"); + } +}