[kotlin][k2] support navigation to multifile class facade

^KTIJ-24067 Fixed

GitOrigin-RevId: d4963f9e90ca92bb210a5086100451acd4867f7b
This commit is contained in:
Dmitrii Gridin
2023-02-01 12:51:59 +00:00
committed by intellij-monorepo-bot
parent cf73c7fa76
commit 9b25324aaa
20 changed files with 433 additions and 14 deletions
@@ -1,4 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.kotlin.idea.base.analysisApiProviders
@@ -89,6 +89,10 @@ private class IdeKotlinDeclarationProvider(
) //TODO original LC has platformSourcesFirst()
}
override fun findInternalFilesForFacade(facadeFqName: FqName): Collection<KtFile> {
return KotlinMultiFileClassPartIndex[facadeFqName.asString(), project, scope]
}
private fun getTypeAliasByClassId(classId: ClassId): KtTypeAlias? {
return firstMatchingOrNull(
stubKey = KotlinTopLevelTypeAliasFqNameIndex.KEY,
@@ -103,15 +107,14 @@ private class IdeKotlinDeclarationProvider(
override fun getTopLevelFunctions(callableId: CallableId): Collection<KtNamedFunction> =
KotlinTopLevelFunctionFqnNameIndex.get(callableId.asTopLevelStringForIndexes(), project, scope)
override fun getTopLevelCallableFiles(callableId: CallableId): Collection<KtFile> {
val callableIdString = callableId.asTopLevelStringForIndexes()
return buildSet {
stubIndex.getContainingFilesIterator(KotlinTopLevelPropertyFqnNameIndex.key, callableIdString, project, scope).forEach {file ->
stubIndex.getContainingFilesIterator(KotlinTopLevelPropertyFqnNameIndex.key, callableIdString, project, scope).forEach { file ->
psiManager.findFile(file)?.safeAs<KtFile>()?.let { add(it) }
}
stubIndex.getContainingFilesIterator(KotlinTopLevelFunctionFqnNameIndex.key, callableIdString, project, scope).forEach {file ->
stubIndex.getContainingFilesIterator(KotlinTopLevelFunctionFqnNameIndex.key, callableIdString, project, scope).forEach { file ->
psiManager.findFile(file)?.safeAs<KtFile>()?.let { add(it) }
}
}
@@ -0,0 +1,17 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.kotlin.idea.fir.resolve
import org.jetbrains.kotlin.idea.fir.invalidateCaches
import org.jetbrains.kotlin.idea.resolve.AbstractReferenceResolveInJavaTest
import org.jetbrains.kotlin.idea.test.runAll
abstract class AbstractFirReferenceResolveInJavaTest : AbstractReferenceResolveInJavaTest() {
override fun isFirPlugin(): Boolean = true
override fun tearDown() {
runAll(
{ project.invalidateCaches() },
{ super.tearDown() },
)
}
}
@@ -0,0 +1,17 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.kotlin.idea.fir.resolve
import org.jetbrains.kotlin.idea.fir.invalidateCaches
import org.jetbrains.kotlin.idea.resolve.AbstractReferenceToCompiledKotlinResolveInJavaTest
import org.jetbrains.kotlin.idea.test.runAll
abstract class AbstractFirReferenceToCompiledKotlinResolveInJavaTest : AbstractReferenceToCompiledKotlinResolveInJavaTest() {
override fun isFirPlugin(): Boolean = true
override fun tearDown() {
runAll(
{ project.invalidateCaches() },
{ super.tearDown() },
)
}
}
@@ -0,0 +1,146 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.kotlin.idea.fir.resolve;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.idea.test.JUnit3RunnerWithInners;
import org.jetbrains.kotlin.idea.test.KotlinTestUtils;
import org.jetbrains.kotlin.test.TestMetadata;
import org.jetbrains.kotlin.idea.base.test.TestRoot;
import org.junit.runner.RunWith;
/**
* This class is generated by {@link org.jetbrains.kotlin.testGenerator.generator.TestGenerator}.
* DO NOT MODIFY MANUALLY.
*/
@SuppressWarnings("all")
@TestRoot("fir")
@TestDataPath("$CONTENT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public abstract class FirReferenceResolveInJavaTestGenerated extends AbstractFirReferenceResolveInJavaTest {
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("../idea/tests/testData/resolve/referenceInJava/binaryAndSource")
public static class BinaryAndSource extends AbstractFirReferenceResolveInJavaTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
@TestMetadata("Class.java")
public void testClass() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/Class.java");
}
@TestMetadata("ClassObjectField.java")
public void testClassObjectField() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/ClassObjectField.java");
}
@TestMetadata("Constructor.java")
public void testConstructor() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/Constructor.java");
}
@TestMetadata("EnumEntry.java")
public void testEnumEntry() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/EnumEntry.java");
}
@TestMetadata("Field.java")
public void testField() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/Field.java");
}
@TestMetadata("FileFacade.java")
public void testFileFacade() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/FileFacade.java");
}
@TestMetadata("Getter.java")
public void testGetter() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/Getter.java");
}
@TestMetadata("Method.java")
public void testMethod() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/Method.java");
}
@TestMetadata("MethodOfDeeplyNested.java")
public void testMethodOfDeeplyNested() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/MethodOfDeeplyNested.java");
}
@TestMetadata("MethodWithParameters.java")
public void testMethodWithParameters() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/MethodWithParameters.java");
}
@TestMetadata("MultifileFacade1.java")
public void testMultifileFacade1() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/MultifileFacade1.java");
}
@TestMetadata("MultifileFacade2.java")
public void testMultifileFacade2() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/MultifileFacade2.java");
}
@TestMetadata("ObjectInstance.java")
public void testObjectInstance() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/ObjectInstance.java");
}
@TestMetadata("PlatformStaticFun.java")
public void testPlatformStaticFun() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/PlatformStaticFun.java");
}
@TestMetadata("SingleFileMultifileFacade.java")
public void testSingleFileMultifileFacade() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/SingleFileMultifileFacade.java");
}
@TestMetadata("TopLevelFunction.java")
public void testTopLevelFunction() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/TopLevelFunction.java");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("../idea/tests/testData/resolve/referenceInJava/sourceOnly")
public static class SourceOnly extends AbstractFirReferenceResolveInJavaTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
@TestMetadata("AnnotationParameterReference.java")
public void testAnnotationParameterReference() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/sourceOnly/AnnotationParameterReference.java");
}
@TestMetadata("AutoGeneratedOverloads.java")
public void testAutoGeneratedOverloads() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/sourceOnly/AutoGeneratedOverloads.java");
}
@TestMetadata("ClassObjectStaticField.java")
public void testClassObjectStaticField() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/sourceOnly/ClassObjectStaticField.java");
}
@TestMetadata("DelegatedMethodFromInterfaceNoImpl.java")
public void testDelegatedMethodFromInterfaceNoImpl() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/sourceOnly/DelegatedMethodFromInterfaceNoImpl.java");
}
@TestMetadata("DelegatedMethodFromInterfaceWithImpl.java")
public void testDelegatedMethodFromInterfaceWithImpl() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/sourceOnly/DelegatedMethodFromInterfaceWithImpl.java");
}
@TestMetadata("KotlinCollection.java")
public void testKotlinCollection() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/sourceOnly/KotlinCollection.java");
}
}
}
@@ -0,0 +1,105 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.kotlin.idea.fir.resolve;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.idea.test.JUnit3RunnerWithInners;
import org.jetbrains.kotlin.idea.test.KotlinTestUtils;
import org.jetbrains.kotlin.test.TestMetadata;
import org.jetbrains.kotlin.idea.base.test.TestRoot;
import org.junit.runner.RunWith;
/**
* This class is generated by {@link org.jetbrains.kotlin.testGenerator.generator.TestGenerator}.
* DO NOT MODIFY MANUALLY.
*/
@SuppressWarnings("all")
@TestRoot("fir")
@TestDataPath("$CONTENT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("../idea/tests/testData/resolve/referenceInJava/binaryAndSource")
public class FirReferenceToCompiledKotlinResolveInJavaTestGenerated extends AbstractFirReferenceToCompiledKotlinResolveInJavaTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
@TestMetadata("Class.java")
public void testClass() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/Class.java");
}
@TestMetadata("ClassObjectField.java")
public void testClassObjectField() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/ClassObjectField.java");
}
@TestMetadata("Constructor.java")
public void testConstructor() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/Constructor.java");
}
@TestMetadata("EnumEntry.java")
public void testEnumEntry() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/EnumEntry.java");
}
@TestMetadata("Field.java")
public void testField() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/Field.java");
}
@TestMetadata("FileFacade.java")
public void testFileFacade() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/FileFacade.java");
}
@TestMetadata("Getter.java")
public void testGetter() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/Getter.java");
}
@TestMetadata("Method.java")
public void testMethod() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/Method.java");
}
@TestMetadata("MethodOfDeeplyNested.java")
public void testMethodOfDeeplyNested() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/MethodOfDeeplyNested.java");
}
@TestMetadata("MethodWithParameters.java")
public void testMethodWithParameters() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/MethodWithParameters.java");
}
@TestMetadata("MultifileFacade1.java")
public void testMultifileFacade1() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/MultifileFacade1.java");
}
@TestMetadata("MultifileFacade2.java")
public void testMultifileFacade2() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/MultifileFacade2.java");
}
@TestMetadata("ObjectInstance.java")
public void testObjectInstance() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/ObjectInstance.java");
}
@TestMetadata("PlatformStaticFun.java")
public void testPlatformStaticFun() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/PlatformStaticFun.java");
}
@TestMetadata("SingleFileMultifileFacade.java")
public void testSingleFileMultifileFacade() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/SingleFileMultifileFacade.java");
}
@TestMetadata("TopLevelFunction.java")
public void testTopLevelFunction() throws Exception {
runTest("../idea/tests/testData/resolve/referenceInJava/binaryAndSource/TopLevelFunction.java");
}
}
@@ -1,4 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.kotlin.asJava.classes
import com.intellij.openapi.roots.ModuleRootModificationUtil
@@ -51,9 +51,9 @@ abstract class AbstractIdeCompiledLightClassesByFqNameTest : KotlinDaemonAnalyze
fun doTest(testDataPath: String) {
val testDataFile = File(testDataPath)
val expectedFile = KotlinTestUtils.replaceExtension(testDataFile, "compiled.java").let {
if (it.exists()) it else KotlinTestUtils.replaceExtension(testDataFile, "java")
}
val expectedFile = KotlinTestUtils.replaceExtension(testDataFile, "compiled.java").takeIf(File::exists)
?: KotlinTestUtils.replaceExtension(testDataFile, "lib.java").takeIf(File::exists)
?: KotlinTestUtils.replaceExtension(testDataFile, "java")
withCustomCompilerOptions(testDataFile.readText(), project, module) {
testLightClass(
@@ -62,6 +62,11 @@ public abstract class IdeCompiledLightClassesByFqNameTestGenerated extends Abstr
runTest(compilerTestData("compiler/testData/asJava/lightClasses/lightClassByFqName/facades/AllPrivate.kt"));
}
@TestMetadata("InternalFacadeClass.kt")
public void testInternalFacadeClass() throws Exception {
runTest(compilerTestData("compiler/testData/asJava/lightClasses/lightClassByFqName/facades/InternalFacadeClass.kt"));
}
@TestMetadata("MultiFile.kt")
public void testMultiFile() throws Exception {
runTest(compilerTestData("compiler/testData/asJava/lightClasses/lightClassByFqName/facades/MultiFile.kt"));
@@ -186,6 +186,11 @@ public abstract class IdeLightClassesByFqNameTestGenerated extends AbstractIdeLi
runTest(compilerTestData("compiler/testData/asJava/lightClasses/lightClassByFqName/facades/AllPrivate.kt"));
}
@TestMetadata("InternalFacadeClass.kt")
public void testInternalFacadeClass() throws Exception {
runTest(compilerTestData("compiler/testData/asJava/lightClasses/lightClassByFqName/facades/InternalFacadeClass.kt"));
}
@TestMetadata("MultiFile.kt")
public void testMultiFile() throws Exception {
runTest(compilerTestData("compiler/testData/asJava/lightClasses/lightClassByFqName/facades/MultiFile.kt"));
@@ -1,4 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.kotlin.idea.resolve
@@ -13,20 +13,23 @@ import org.jetbrains.kotlin.idea.test.runAll
import org.jetbrains.kotlin.psi.KtDeclaration
import org.junit.Assert
private val FILE_WITH_KOTLIN_CODE = IDEA_TEST_DATA_DIR.resolve("resolve/referenceInJava/dependency/dependencies.kt")
private val DIRECTORY_WITH_KOTLIN_CODE = IDEA_TEST_DATA_DIR.resolve("resolve/referenceInJava/dependency")
abstract class AbstractReferenceResolveInJavaTest : AbstractReferenceResolveTest() {
override fun doTest(path: String) {
val fileName = fileName()
assert(fileName.endsWith(".java")) { fileName }
myFixture.configureByText("dependencies.kt", FileUtil.loadFile(FILE_WITH_KOTLIN_CODE, true))
DIRECTORY_WITH_KOTLIN_CODE.listFiles()?.forEach {
myFixture.configureByText(it.name, FileUtil.loadFile(it, true))
}
myFixture.configureByFile(fileName)
performChecks()
}
}
abstract class AbstractReferenceToCompiledKotlinResolveInJavaTest : AbstractReferenceResolveTest() {
private val mockLibraryFacility = MockLibraryFacility(FILE_WITH_KOTLIN_CODE)
private val mockLibraryFacility = MockLibraryFacility(DIRECTORY_WITH_KOTLIN_CODE)
override fun doTest(path: String) {
myFixture.configureByFile(fileName())
@@ -75,6 +75,16 @@ public abstract class ReferenceResolveInJavaTestGenerated extends AbstractRefere
runTest("testData/resolve/referenceInJava/binaryAndSource/MethodWithParameters.java");
}
@TestMetadata("MultifileFacade1.java")
public void testMultifileFacade1() throws Exception {
runTest("testData/resolve/referenceInJava/binaryAndSource/MultifileFacade1.java");
}
@TestMetadata("MultifileFacade2.java")
public void testMultifileFacade2() throws Exception {
runTest("testData/resolve/referenceInJava/binaryAndSource/MultifileFacade2.java");
}
@TestMetadata("ObjectInstance.java")
public void testObjectInstance() throws Exception {
runTest("testData/resolve/referenceInJava/binaryAndSource/ObjectInstance.java");
@@ -84,6 +94,16 @@ public abstract class ReferenceResolveInJavaTestGenerated extends AbstractRefere
public void testPlatformStaticFun() throws Exception {
runTest("testData/resolve/referenceInJava/binaryAndSource/PlatformStaticFun.java");
}
@TestMetadata("SingleFileMultifileFacade.java")
public void testSingleFileMultifileFacade() throws Exception {
runTest("testData/resolve/referenceInJava/binaryAndSource/SingleFileMultifileFacade.java");
}
@TestMetadata("TopLevelFunction.java")
public void testTopLevelFunction() throws Exception {
runTest("testData/resolve/referenceInJava/binaryAndSource/TopLevelFunction.java");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@@ -117,5 +137,10 @@ public abstract class ReferenceResolveInJavaTestGenerated extends AbstractRefere
public void testDelegatedMethodFromInterfaceWithImpl() throws Exception {
runTest("testData/resolve/referenceInJava/sourceOnly/DelegatedMethodFromInterfaceWithImpl.java");
}
@TestMetadata("KotlinCollection.java")
public void testKotlinCollection() throws Exception {
runTest("testData/resolve/referenceInJava/sourceOnly/KotlinCollection.java");
}
}
}
@@ -73,6 +73,16 @@ public class ReferenceToCompiledKotlinResolveInJavaTestGenerated extends Abstrac
runTest("testData/resolve/referenceInJava/binaryAndSource/MethodWithParameters.java");
}
@TestMetadata("MultifileFacade1.java")
public void testMultifileFacade1() throws Exception {
runTest("testData/resolve/referenceInJava/binaryAndSource/MultifileFacade1.java");
}
@TestMetadata("MultifileFacade2.java")
public void testMultifileFacade2() throws Exception {
runTest("testData/resolve/referenceInJava/binaryAndSource/MultifileFacade2.java");
}
@TestMetadata("ObjectInstance.java")
public void testObjectInstance() throws Exception {
runTest("testData/resolve/referenceInJava/binaryAndSource/ObjectInstance.java");
@@ -82,4 +92,14 @@ public class ReferenceToCompiledKotlinResolveInJavaTestGenerated extends Abstrac
public void testPlatformStaticFun() throws Exception {
runTest("testData/resolve/referenceInJava/binaryAndSource/PlatformStaticFun.java");
}
@TestMetadata("SingleFileMultifileFacade.java")
public void testSingleFileMultifileFacade() throws Exception {
runTest("testData/resolve/referenceInJava/binaryAndSource/SingleFileMultifileFacade.java");
}
@TestMetadata("TopLevelFunction.java")
public void testTopLevelFunction() throws Exception {
runTest("testData/resolve/referenceInJava/binaryAndSource/TopLevelFunction.java");
}
}
@@ -0,0 +1,8 @@
public class MultifileFacade1 {
void t() {
two.MultiFacade.topL<caret>evelFunction1();
}
}
// REF: (two).topLevelFunction1()
// CLS_REF: (two).topLevelFunction1()
@@ -0,0 +1,8 @@
public class MultifileFacade2 {
void t() {
two.MultiFacade.topL<caret>evelFunction2();
}
}
// REF: (two).topLevelFunction2()
// CLS_REF: (two).topLevelFunction2()
@@ -0,0 +1,11 @@
import one.SingleFacade;
public class SingleFileMultifileFacade {
void t() {
SingleFacade.topLevelFunct<caret>ion();
}
}
// REF: (one).topLevelFunction()
// CLS_REF: (one).topLevelFunction()
@@ -0,0 +1,8 @@
public class TopLevelFunction {
public static void foo() {
k.DependenciesKt.<caret>withJvmOverloads(4);
}
}
// REF: (k).withJvmOverloads(Int, Boolean, String)
// CLS_REF: (k).withJvmOverloads(Int, Boolean, String)
@@ -0,0 +1,6 @@
@file:[JvmMultifileClass JvmName("MultiFacade")]
package two
fun topLevelFunction1() {
}
@@ -0,0 +1,6 @@
@file:[JvmMultifileClass JvmName("MultiFacade")]
package two
fun topLevelFunction2() {
}
@@ -0,0 +1,6 @@
@file:[JvmMultifileClass JvmName("SingleFacade")]
package one
fun topLevelFunction() {
}
@@ -0,0 +1,9 @@
import kotlin.collections.CollectionsKt;
public class KotlinReferrer {
public void refer() {
CollectionsKt.array<caret>ListOf(1);
}
}
// REF: (kotlin.collections).arrayListOf(vararg T)
@@ -1,4 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.kotlin.fir.testGenerator
@@ -23,7 +23,9 @@ import org.jetbrains.kotlin.idea.fir.low.level.api.AbstractFirLibraryModuleDecla
import org.jetbrains.kotlin.idea.fir.parameterInfo.AbstractFirParameterInfoTest
import org.jetbrains.kotlin.idea.fir.quickfix.AbstractHighLevelQuickFixMultiFileTest
import org.jetbrains.kotlin.idea.fir.quickfix.AbstractHighLevelQuickFixTest
import org.jetbrains.kotlin.idea.fir.resolve.AbstractFirReferenceResolveInJavaTest
import org.jetbrains.kotlin.idea.fir.resolve.AbstractFirReferenceResolveTest
import org.jetbrains.kotlin.idea.fir.resolve.AbstractFirReferenceToCompiledKotlinResolveInJavaTest
import org.jetbrains.kotlin.idea.fir.search.AbstractHLImplementationSearcherTest
import org.jetbrains.kotlin.idea.fir.shortenRefs.AbstractFirShortenRefsTest
import org.jetbrains.kotlin.idea.fir.uast.*
@@ -31,6 +33,7 @@ import org.jetbrains.kotlin.idea.k2.refactoring.rename.AbstractFirRenameTest
import org.jetbrains.kotlin.testGenerator.generator.TestGenerator
import org.jetbrains.kotlin.testGenerator.model.*
import org.jetbrains.kotlin.testGenerator.model.Patterns.DIRECTORY
import org.jetbrains.kotlin.testGenerator.model.Patterns.JAVA
import org.jetbrains.kotlin.testGenerator.model.Patterns.KT_OR_KTS_WITHOUT_DOTS
import org.jetbrains.kotlin.testGenerator.model.Patterns.KT_WITHOUT_DOTS
import org.jetbrains.kotlin.testGenerator.model.Patterns.KT_WITHOUT_DOT_AND_FIR_PREFIX
@@ -79,6 +82,14 @@ private fun assembleWorkspace(): TWorkspace = workspace {
model("resolve/references", pattern = KT_WITHOUT_DOTS)
}
testClass<AbstractFirReferenceResolveInJavaTest> {
model("resolve/referenceInJava/binaryAndSource", pattern = JAVA)
model("resolve/referenceInJava/sourceOnly", pattern = JAVA)
}
testClass<AbstractFirReferenceToCompiledKotlinResolveInJavaTest> {
model("resolve/referenceInJava/binaryAndSource", pattern = JAVA)
}
testClass<AbstractHighLevelQuickFixTest> {
val pattern = Patterns.forRegex("^([\\w\\-_]+)\\.kt$")
@@ -226,7 +237,7 @@ private fun assembleWorkspace(): TWorkspace = workspace {
testClass<AbstractHLImplementationSearcherTest> {
model("search/implementations", pattern = KT_WITHOUT_DOTS)
}
testClass<AbstractFirQuickDocTest> {
model("quickDoc", pattern = Patterns.forRegex("""^([^_]+)\.(kt|java)$"""))
}