[Analysis API FIR] implement reference resolve inside KDoc
^KTIJ-22324 fixed
This commit is contained in:
@@ -90,3 +90,7 @@ val generateCode by tasks.registering(NoDebugJavaExec::class) {
|
||||
val compileKotlin by tasks
|
||||
|
||||
compileKotlin.dependsOn(generateCode)
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
||||
kotlinOptions.freeCompilerArgs += "-Xcontext-receivers"
|
||||
}
|
||||
|
||||
+176
@@ -0,0 +1,176 @@
|
||||
/*
|
||||
* Copyright 2010-2022 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.analysis.api.fir.references
|
||||
|
||||
import org.jetbrains.kotlin.analysis.api.KtAnalysisSession
|
||||
import org.jetbrains.kotlin.analysis.api.symbols.*
|
||||
import org.jetbrains.kotlin.analysis.api.symbols.markers.KtSymbolWithMembers
|
||||
import org.jetbrains.kotlin.name.CallableId
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.psi.KtDeclaration
|
||||
|
||||
internal object KDocReferenceResolver {
|
||||
|
||||
context(KtAnalysisSession)
|
||||
internal fun resolveKdocFqName(fqName: FqName, owner: KtDeclaration?): Collection<KtSymbol> = buildSet {
|
||||
collectSymbolsByFullyQualifiedName(fqName)
|
||||
|
||||
if (owner != null) {
|
||||
collectSymbolsFromPositionScopes(owner, fqName)
|
||||
val ownerSymbol = owner.getSymbol()
|
||||
|
||||
val pathSegments = fqName.pathSegments()
|
||||
if (pathSegments.size == 1) {
|
||||
val singleSegment = pathSegments.single()
|
||||
when {
|
||||
owner is KtConstructorSymbol -> {
|
||||
collectConstructorParameterSymbols(owner, singleSegment)
|
||||
}
|
||||
|
||||
ownerSymbol is KtNamedClassOrObjectSymbol -> {
|
||||
collectPrimaryConstructorParameterSymbols(ownerSymbol, singleSegment)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
context(KtAnalysisSession)
|
||||
private fun MutableCollection<KtSymbol>.collectPrimaryConstructorParameterSymbols(owner: KtNamedClassOrObjectSymbol, name: Name) {
|
||||
val primaryConstructor = owner.getDeclaredMemberScope().getConstructors().firstOrNull { it.isPrimary } ?: return
|
||||
collectConstructorParameterSymbols(primaryConstructor, name)
|
||||
}
|
||||
|
||||
context(KtAnalysisSession)
|
||||
private fun MutableCollection<KtSymbol>.collectSymbolsFromPositionScopes(owner: KtDeclaration, fqName: FqName) {
|
||||
val initialScope = owner.containingKtFile.getScopeContextForPosition(owner).scopes
|
||||
|
||||
val scope = fqName.pathSegments()
|
||||
.dropLast(1)
|
||||
.fold(initialScope) { currentScope, fqNamePart ->
|
||||
currentScope
|
||||
.getClassifierSymbols { it == fqNamePart }
|
||||
.mapNotNull { (it as? KtSymbolWithMembers)?.getDeclaredMemberScope() }
|
||||
.toList()
|
||||
.asCompositeScope()
|
||||
}
|
||||
|
||||
val shortName = fqName.shortName()
|
||||
addAll(scope.getCallableSymbols { it == shortName })
|
||||
addAll(scope.getClassifierSymbols { it == shortName })
|
||||
}
|
||||
|
||||
context(KtAnalysisSession, MutableCollection<KtSymbol>)
|
||||
private fun collectConstructorParameterSymbols(owner: KtFunctionLikeSymbol, name: Name) {
|
||||
for (valueParameter in owner.valueParameters) {
|
||||
if (valueParameter.name == name) {
|
||||
add(valueParameter)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
context(KtAnalysisSession)
|
||||
private fun MutableCollection<KtSymbol>.collectSymbolsByFullyQualifiedName(fqName: FqName) {
|
||||
generateNameInterpretations(fqName).forEach { interpretation ->
|
||||
collectSymbolsByFqNameInterpretation(interpretation)
|
||||
}
|
||||
}
|
||||
|
||||
context(KtAnalysisSession)
|
||||
private fun MutableCollection<KtSymbol>.collectSymbolsByFqNameInterpretation(
|
||||
interpretation: FqNameInterpretation,
|
||||
) {
|
||||
when (interpretation) {
|
||||
is FqNameInterpretation.FqNameInterpretationAsCallableId -> {
|
||||
collectSymbolsByFqNameInterpretationAsCallableId(interpretation.callableId)
|
||||
}
|
||||
|
||||
is FqNameInterpretation.FqNameInterpretationAsClassId -> {
|
||||
collectSymbolsByClassId(interpretation.classId)
|
||||
}
|
||||
|
||||
is FqNameInterpretation.FqNameInterpretationAsPackage -> {
|
||||
collectSymbolsByPackage(interpretation.packageFqName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
context(KtAnalysisSession)
|
||||
private fun MutableCollection<KtSymbol>.collectSymbolsByPackage(packageFqName: FqName) {
|
||||
getPackageSymbolIfPackageExists(packageFqName)?.let(::add)
|
||||
}
|
||||
|
||||
context(KtAnalysisSession, MutableCollection<KtSymbol>)
|
||||
private fun collectSymbolsByClassId(classId: ClassId) {
|
||||
classId.getCorrespondingToplevelClassOrObjectSymbol()?.let(::add)
|
||||
}
|
||||
|
||||
context(KtAnalysisSession)
|
||||
private fun MutableCollection<KtSymbol>.collectSymbolsByFqNameInterpretationAsCallableId(callableId: CallableId) {
|
||||
when (val classId = callableId.classId) {
|
||||
null -> {
|
||||
addAll(callableId.packageName.getContainingCallableSymbolsWithName(callableId.callableName))
|
||||
}
|
||||
|
||||
else -> {
|
||||
classId.getCorrespondingToplevelClassOrObjectSymbol()
|
||||
?.getDeclaredMemberScope()
|
||||
?.getCallableSymbols { it == callableId.callableName }
|
||||
?.let(::addAll)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun generateNameInterpretations(fqName: FqName): Sequence<FqNameInterpretation> = sequence {
|
||||
val parts = fqName.pathSegments()
|
||||
if (parts.isEmpty()) {
|
||||
yield(FqNameInterpretation.create(packageParts = emptyList(), classParts = emptyList(), callable = null))
|
||||
return@sequence
|
||||
}
|
||||
for (lastPackagePartIndexExclusive in 0..parts.size) {
|
||||
yield(
|
||||
FqNameInterpretation.create(
|
||||
packageParts = parts.subList(0, lastPackagePartIndexExclusive),
|
||||
classParts = parts.subList(lastPackagePartIndexExclusive, parts.size),
|
||||
callable = null,
|
||||
)
|
||||
)
|
||||
|
||||
if (lastPackagePartIndexExclusive <= parts.size - 1) {
|
||||
yield(
|
||||
FqNameInterpretation.create(
|
||||
packageParts = parts.subList(0, lastPackagePartIndexExclusive),
|
||||
classParts = parts.subList(lastPackagePartIndexExclusive, parts.size - 1),
|
||||
callable = parts.last(),
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class FqNameInterpretation {
|
||||
|
||||
data class FqNameInterpretationAsPackage(val packageFqName: FqName) : FqNameInterpretation()
|
||||
data class FqNameInterpretationAsClassId(val classId: ClassId) : FqNameInterpretation()
|
||||
data class FqNameInterpretationAsCallableId(val callableId: CallableId) : FqNameInterpretation()
|
||||
|
||||
companion object {
|
||||
fun create(packageParts: List<Name>, classParts: List<Name>, callable: Name?): FqNameInterpretation {
|
||||
val packageName = FqName.fromSegments(packageParts.map { it.asString() })
|
||||
val relativeClassName = FqName.fromSegments(classParts.map { it.asString() })
|
||||
|
||||
return when {
|
||||
classParts.isEmpty() && callable == null -> FqNameInterpretationAsPackage(packageName)
|
||||
callable == null -> FqNameInterpretationAsClassId(ClassId(packageName, relativeClassName, false))
|
||||
else -> FqNameInterpretationAsCallableId(CallableId(packageName, relativeClassName.takeUnless { it.isRoot }, callable))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.idea.references
|
||||
|
||||
import org.jetbrains.kotlin.analysis.api.fir.references.KtFirKDocReference
|
||||
import org.jetbrains.kotlin.psi.KtSimpleNameExpression
|
||||
import org.jetbrains.kotlin.resolve.references.ReferenceAccess
|
||||
|
||||
@@ -18,6 +19,7 @@ class KotlinFirReferenceContributor : KotlinReferenceProviderContributor {
|
||||
registerProvider(factory = ::KtFirArrayAccessReference)
|
||||
registerProvider(factory = ::KtFirConstructorDelegationReference)
|
||||
registerProvider(factory = ::KtFirCollectionLiteralReference)
|
||||
registerProvider(factory = ::KtFirKDocReference)
|
||||
|
||||
registerMultiProvider<KtSimpleNameExpression> { nameReferenceExpression ->
|
||||
when (nameReferenceExpression.readWriteAccess(useResolveForReadWrite = true)) {
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright 2010-2022 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.analysis.api.fir.references
|
||||
|
||||
import org.jetbrains.kotlin.analysis.api.KtAnalysisSession
|
||||
import org.jetbrains.kotlin.analysis.api.fir.KtFirAnalysisSession
|
||||
import org.jetbrains.kotlin.analysis.api.symbols.KtSymbol
|
||||
import org.jetbrains.kotlin.analysis.utils.printer.parentOfType
|
||||
import org.jetbrains.kotlin.idea.references.KDocReference
|
||||
import org.jetbrains.kotlin.idea.references.KtFirReference
|
||||
import org.jetbrains.kotlin.kdoc.psi.impl.KDocName
|
||||
import org.jetbrains.kotlin.psi.KtDeclaration
|
||||
|
||||
|
||||
internal class KtFirKDocReference(element: KDocName) : KDocReference(element), KtFirReference {
|
||||
override fun KtAnalysisSession.resolveToSymbols(): Collection<KtSymbol> {
|
||||
val owner = element.parentOfType<KtDeclaration>()
|
||||
return KDocReferenceResolver.resolveKdocFqName(element.getQualifiedNameAsFqName(), owner)
|
||||
}
|
||||
}
|
||||
+4
@@ -169,6 +169,10 @@ internal class KtFirSymbolProvider(
|
||||
return firs.asSequence().map { firSymbol -> firSymbolBuilder.buildSymbol(firSymbol) }
|
||||
}
|
||||
|
||||
override fun getPackageSymbolIfPackageExists(packageFqName: FqName): KtPackageSymbol? {
|
||||
return firSymbolBuilder.createPackageSymbolIfOneExists(packageFqName)
|
||||
}
|
||||
|
||||
override val ROOT_PACKAGE_SYMBOL: KtPackageSymbol = KtFirPackageSymbol(FqName.ROOT, firResolveSession.project, token)
|
||||
|
||||
override fun getDestructuringDeclarationEntrySymbol(psi: KtDestructuringDeclarationEntry): KtLocalVariableSymbol {
|
||||
|
||||
+246
@@ -1040,6 +1040,252 @@ public class FirIdeDependentAnalysisSourceModuleReferenceResolveTestGenerated ex
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/analysis-api/testData/referenceResolve/kDoc")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class KDoc {
|
||||
@Test
|
||||
public void testAllFilesPresentInKDoc() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/referenceResolve/kDoc"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/analysis-api/testData/referenceResolve/kDoc/localContext")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class LocalContext {
|
||||
@Test
|
||||
public void testAllFilesPresentInLocalContext() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/referenceResolve/kDoc/localContext"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("LocalSemiFullQualifiedCallableName.kt")
|
||||
public void testLocalSemiFullQualifiedCallableName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/LocalSemiFullQualifiedCallableName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("LocalSemiFullQualifiedClassName.kt")
|
||||
public void testLocalSemiFullQualifiedClassName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/LocalSemiFullQualifiedClassName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("NonLocalSemiFullQualifiedCallableName.kt")
|
||||
public void testNonLocalSemiFullQualifiedCallableName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/NonLocalSemiFullQualifiedCallableName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("NonLocalSemiFullQualifiedClassName.kt")
|
||||
public void testNonLocalSemiFullQualifiedClassName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/NonLocalSemiFullQualifiedClassName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SelfLocalMethod.kt")
|
||||
public void testSelfLocalMethod() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/SelfLocalMethod.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SelfLocalProperty.kt")
|
||||
public void testSelfLocalProperty() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/SelfLocalProperty.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SelfNonLocalMethod.kt")
|
||||
public void testSelfNonLocalMethod() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/SelfNonLocalMethod.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SelfNonLocalProperty.kt")
|
||||
public void testSelfNonLocalProperty() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/SelfNonLocalProperty.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SiblingLocalMethod.kt")
|
||||
public void testSiblingLocalMethod() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/SiblingLocalMethod.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SiblingLocalProperty.kt")
|
||||
public void testSiblingLocalProperty() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/SiblingLocalProperty.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SiblingNonLocalProperty.kt")
|
||||
public void testSiblingNonLocalProperty() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/SiblingNonLocalProperty.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/analysis-api/testData/referenceResolve/kDoc/parameters")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Parameters {
|
||||
@Test
|
||||
public void testAllFilesPresentInParameters() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/referenceResolve/kDoc/parameters"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ClassPrimaryConstructorParameter.kt")
|
||||
public void testClassPrimaryConstructorParameter() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/parameters/ClassPrimaryConstructorParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ClassPrimaryConstructorValParameter.kt")
|
||||
public void testClassPrimaryConstructorValParameter() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/parameters/ClassPrimaryConstructorValParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ClassTypeParameter.kt")
|
||||
public void testClassTypeParameter() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/parameters/ClassTypeParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ConstructorValueParameter.kt")
|
||||
public void testConstructorValueParameter() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/parameters/ConstructorValueParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("FunctionTypeParameter.kt")
|
||||
public void testFunctionTypeParameter() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/parameters/FunctionTypeParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("FunctionValueParameter.kt")
|
||||
public void testFunctionValueParameter() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/parameters/FunctionValueParameter.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/analysis-api/testData/referenceResolve/kDoc/qualified")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Qualified {
|
||||
@Test
|
||||
public void testAllFilesPresentInQualified() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/referenceResolve/kDoc/qualified"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class FromOtherFile {
|
||||
@Test
|
||||
public void testAllFilesPresentInFromOtherFile() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryFromOtherByShortName.kt")
|
||||
public void testEnumEntryFromOtherByShortName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/EnumEntryFromOtherByShortName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryFromOtherFileByFullName.kt")
|
||||
public void testEnumEntryFromOtherFileByFullName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/EnumEntryFromOtherFileByFullName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("NestedClassFromOtherFileByFullName.kt")
|
||||
public void testNestedClassFromOtherFileByFullName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/NestedClassFromOtherFileByFullName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("NestedClassFromOtherFileByShortName.kt")
|
||||
public void testNestedClassFromOtherFileByShortName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/NestedClassFromOtherFileByShortName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelClassFromOtherFileByFullName.kt")
|
||||
public void testTopLevelClassFromOtherFileByFullName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/TopLevelClassFromOtherFileByFullName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelClassFromOtherFileByShortName.kt")
|
||||
public void testTopLevelClassFromOtherFileByShortName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/TopLevelClassFromOtherFileByShortName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelFunctionFromOtherFileByFullName.kt")
|
||||
public void testTopLevelFunctionFromOtherFileByFullName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/TopLevelFunctionFromOtherFileByFullName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelFunctionFromStdlibByShortName.kt")
|
||||
public void testTopLevelFunctionFromStdlibByShortName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/TopLevelFunctionFromStdlibByShortName.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Stdlib {
|
||||
@Test
|
||||
public void testAllFilesPresentInStdlib() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryFromStdlibByFullName.kt")
|
||||
public void testEnumEntryFromStdlibByFullName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib/EnumEntryFromStdlibByFullName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryFromStdlibByShortName.kt")
|
||||
public void testEnumEntryFromStdlibByShortName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib/EnumEntryFromStdlibByShortName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelClassFromStdlibByFullName.kt")
|
||||
public void testTopLevelClassFromStdlibByFullName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib/TopLevelClassFromStdlibByFullName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelClassFromStdlibByShortName.kt")
|
||||
public void testTopLevelClassFromStdlibByShortName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib/TopLevelClassFromStdlibByShortName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelFunctionFromStdlibByFullName.kt")
|
||||
public void testTopLevelFunctionFromStdlibByFullName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib/TopLevelFunctionFromStdlibByFullName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelFunctionFromStdlibByShortName.kt")
|
||||
public void testTopLevelFunctionFromStdlibByShortName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib/TopLevelFunctionFromStdlibByShortName.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/analysis-api/testData/referenceResolve/nestedTypes")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+246
@@ -930,6 +930,252 @@ public class FirIdeNormalAnalysisLibrarySourceModuleReferenceResolveTestGenerate
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/analysis-api/testData/referenceResolve/kDoc")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class KDoc {
|
||||
@Test
|
||||
public void testAllFilesPresentInKDoc() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/referenceResolve/kDoc"), Pattern.compile("^([^.]+)\\.kt$"), null, true, "withErrors");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/analysis-api/testData/referenceResolve/kDoc/localContext")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class LocalContext {
|
||||
@Test
|
||||
public void testAllFilesPresentInLocalContext() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/referenceResolve/kDoc/localContext"), Pattern.compile("^([^.]+)\\.kt$"), null, true, "withErrors");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("LocalSemiFullQualifiedCallableName.kt")
|
||||
public void testLocalSemiFullQualifiedCallableName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/LocalSemiFullQualifiedCallableName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("LocalSemiFullQualifiedClassName.kt")
|
||||
public void testLocalSemiFullQualifiedClassName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/LocalSemiFullQualifiedClassName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("NonLocalSemiFullQualifiedCallableName.kt")
|
||||
public void testNonLocalSemiFullQualifiedCallableName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/NonLocalSemiFullQualifiedCallableName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("NonLocalSemiFullQualifiedClassName.kt")
|
||||
public void testNonLocalSemiFullQualifiedClassName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/NonLocalSemiFullQualifiedClassName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SelfLocalMethod.kt")
|
||||
public void testSelfLocalMethod() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/SelfLocalMethod.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SelfLocalProperty.kt")
|
||||
public void testSelfLocalProperty() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/SelfLocalProperty.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SelfNonLocalMethod.kt")
|
||||
public void testSelfNonLocalMethod() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/SelfNonLocalMethod.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SelfNonLocalProperty.kt")
|
||||
public void testSelfNonLocalProperty() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/SelfNonLocalProperty.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SiblingLocalMethod.kt")
|
||||
public void testSiblingLocalMethod() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/SiblingLocalMethod.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SiblingLocalProperty.kt")
|
||||
public void testSiblingLocalProperty() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/SiblingLocalProperty.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SiblingNonLocalProperty.kt")
|
||||
public void testSiblingNonLocalProperty() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/SiblingNonLocalProperty.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/analysis-api/testData/referenceResolve/kDoc/parameters")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Parameters {
|
||||
@Test
|
||||
public void testAllFilesPresentInParameters() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/referenceResolve/kDoc/parameters"), Pattern.compile("^([^.]+)\\.kt$"), null, true, "withErrors");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ClassPrimaryConstructorParameter.kt")
|
||||
public void testClassPrimaryConstructorParameter() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/parameters/ClassPrimaryConstructorParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ClassPrimaryConstructorValParameter.kt")
|
||||
public void testClassPrimaryConstructorValParameter() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/parameters/ClassPrimaryConstructorValParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ClassTypeParameter.kt")
|
||||
public void testClassTypeParameter() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/parameters/ClassTypeParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ConstructorValueParameter.kt")
|
||||
public void testConstructorValueParameter() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/parameters/ConstructorValueParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("FunctionTypeParameter.kt")
|
||||
public void testFunctionTypeParameter() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/parameters/FunctionTypeParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("FunctionValueParameter.kt")
|
||||
public void testFunctionValueParameter() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/parameters/FunctionValueParameter.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/analysis-api/testData/referenceResolve/kDoc/qualified")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Qualified {
|
||||
@Test
|
||||
public void testAllFilesPresentInQualified() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/referenceResolve/kDoc/qualified"), Pattern.compile("^([^.]+)\\.kt$"), null, true, "withErrors");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class FromOtherFile {
|
||||
@Test
|
||||
public void testAllFilesPresentInFromOtherFile() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile"), Pattern.compile("^([^.]+)\\.kt$"), null, true, "withErrors");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryFromOtherByShortName.kt")
|
||||
public void testEnumEntryFromOtherByShortName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/EnumEntryFromOtherByShortName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryFromOtherFileByFullName.kt")
|
||||
public void testEnumEntryFromOtherFileByFullName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/EnumEntryFromOtherFileByFullName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("NestedClassFromOtherFileByFullName.kt")
|
||||
public void testNestedClassFromOtherFileByFullName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/NestedClassFromOtherFileByFullName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("NestedClassFromOtherFileByShortName.kt")
|
||||
public void testNestedClassFromOtherFileByShortName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/NestedClassFromOtherFileByShortName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelClassFromOtherFileByFullName.kt")
|
||||
public void testTopLevelClassFromOtherFileByFullName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/TopLevelClassFromOtherFileByFullName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelClassFromOtherFileByShortName.kt")
|
||||
public void testTopLevelClassFromOtherFileByShortName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/TopLevelClassFromOtherFileByShortName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelFunctionFromOtherFileByFullName.kt")
|
||||
public void testTopLevelFunctionFromOtherFileByFullName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/TopLevelFunctionFromOtherFileByFullName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelFunctionFromStdlibByShortName.kt")
|
||||
public void testTopLevelFunctionFromStdlibByShortName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/TopLevelFunctionFromStdlibByShortName.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Stdlib {
|
||||
@Test
|
||||
public void testAllFilesPresentInStdlib() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib"), Pattern.compile("^([^.]+)\\.kt$"), null, true, "withErrors");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryFromStdlibByFullName.kt")
|
||||
public void testEnumEntryFromStdlibByFullName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib/EnumEntryFromStdlibByFullName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryFromStdlibByShortName.kt")
|
||||
public void testEnumEntryFromStdlibByShortName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib/EnumEntryFromStdlibByShortName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelClassFromStdlibByFullName.kt")
|
||||
public void testTopLevelClassFromStdlibByFullName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib/TopLevelClassFromStdlibByFullName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelClassFromStdlibByShortName.kt")
|
||||
public void testTopLevelClassFromStdlibByShortName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib/TopLevelClassFromStdlibByShortName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelFunctionFromStdlibByFullName.kt")
|
||||
public void testTopLevelFunctionFromStdlibByFullName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib/TopLevelFunctionFromStdlibByFullName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelFunctionFromStdlibByShortName.kt")
|
||||
public void testTopLevelFunctionFromStdlibByShortName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib/TopLevelFunctionFromStdlibByShortName.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/analysis-api/testData/referenceResolve/nestedTypes")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+246
@@ -1040,6 +1040,252 @@ public class FirIdeNormalAnalysisSourceModuleReferenceResolveTestGenerated exten
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/analysis-api/testData/referenceResolve/kDoc")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class KDoc {
|
||||
@Test
|
||||
public void testAllFilesPresentInKDoc() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/referenceResolve/kDoc"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/analysis-api/testData/referenceResolve/kDoc/localContext")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class LocalContext {
|
||||
@Test
|
||||
public void testAllFilesPresentInLocalContext() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/referenceResolve/kDoc/localContext"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("LocalSemiFullQualifiedCallableName.kt")
|
||||
public void testLocalSemiFullQualifiedCallableName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/LocalSemiFullQualifiedCallableName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("LocalSemiFullQualifiedClassName.kt")
|
||||
public void testLocalSemiFullQualifiedClassName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/LocalSemiFullQualifiedClassName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("NonLocalSemiFullQualifiedCallableName.kt")
|
||||
public void testNonLocalSemiFullQualifiedCallableName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/NonLocalSemiFullQualifiedCallableName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("NonLocalSemiFullQualifiedClassName.kt")
|
||||
public void testNonLocalSemiFullQualifiedClassName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/NonLocalSemiFullQualifiedClassName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SelfLocalMethod.kt")
|
||||
public void testSelfLocalMethod() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/SelfLocalMethod.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SelfLocalProperty.kt")
|
||||
public void testSelfLocalProperty() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/SelfLocalProperty.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SelfNonLocalMethod.kt")
|
||||
public void testSelfNonLocalMethod() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/SelfNonLocalMethod.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SelfNonLocalProperty.kt")
|
||||
public void testSelfNonLocalProperty() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/SelfNonLocalProperty.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SiblingLocalMethod.kt")
|
||||
public void testSiblingLocalMethod() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/SiblingLocalMethod.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SiblingLocalProperty.kt")
|
||||
public void testSiblingLocalProperty() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/SiblingLocalProperty.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SiblingNonLocalProperty.kt")
|
||||
public void testSiblingNonLocalProperty() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/localContext/SiblingNonLocalProperty.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/analysis-api/testData/referenceResolve/kDoc/parameters")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Parameters {
|
||||
@Test
|
||||
public void testAllFilesPresentInParameters() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/referenceResolve/kDoc/parameters"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ClassPrimaryConstructorParameter.kt")
|
||||
public void testClassPrimaryConstructorParameter() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/parameters/ClassPrimaryConstructorParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ClassPrimaryConstructorValParameter.kt")
|
||||
public void testClassPrimaryConstructorValParameter() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/parameters/ClassPrimaryConstructorValParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ClassTypeParameter.kt")
|
||||
public void testClassTypeParameter() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/parameters/ClassTypeParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ConstructorValueParameter.kt")
|
||||
public void testConstructorValueParameter() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/parameters/ConstructorValueParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("FunctionTypeParameter.kt")
|
||||
public void testFunctionTypeParameter() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/parameters/FunctionTypeParameter.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("FunctionValueParameter.kt")
|
||||
public void testFunctionValueParameter() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/parameters/FunctionValueParameter.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/analysis-api/testData/referenceResolve/kDoc/qualified")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Qualified {
|
||||
@Test
|
||||
public void testAllFilesPresentInQualified() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/referenceResolve/kDoc/qualified"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class FromOtherFile {
|
||||
@Test
|
||||
public void testAllFilesPresentInFromOtherFile() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryFromOtherByShortName.kt")
|
||||
public void testEnumEntryFromOtherByShortName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/EnumEntryFromOtherByShortName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryFromOtherFileByFullName.kt")
|
||||
public void testEnumEntryFromOtherFileByFullName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/EnumEntryFromOtherFileByFullName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("NestedClassFromOtherFileByFullName.kt")
|
||||
public void testNestedClassFromOtherFileByFullName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/NestedClassFromOtherFileByFullName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("NestedClassFromOtherFileByShortName.kt")
|
||||
public void testNestedClassFromOtherFileByShortName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/NestedClassFromOtherFileByShortName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelClassFromOtherFileByFullName.kt")
|
||||
public void testTopLevelClassFromOtherFileByFullName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/TopLevelClassFromOtherFileByFullName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelClassFromOtherFileByShortName.kt")
|
||||
public void testTopLevelClassFromOtherFileByShortName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/TopLevelClassFromOtherFileByShortName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelFunctionFromOtherFileByFullName.kt")
|
||||
public void testTopLevelFunctionFromOtherFileByFullName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/TopLevelFunctionFromOtherFileByFullName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelFunctionFromStdlibByShortName.kt")
|
||||
public void testTopLevelFunctionFromStdlibByShortName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/fromOtherFile/TopLevelFunctionFromStdlibByShortName.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Stdlib {
|
||||
@Test
|
||||
public void testAllFilesPresentInStdlib() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryFromStdlibByFullName.kt")
|
||||
public void testEnumEntryFromStdlibByFullName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib/EnumEntryFromStdlibByFullName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryFromStdlibByShortName.kt")
|
||||
public void testEnumEntryFromStdlibByShortName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib/EnumEntryFromStdlibByShortName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelClassFromStdlibByFullName.kt")
|
||||
public void testTopLevelClassFromStdlibByFullName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib/TopLevelClassFromStdlibByFullName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelClassFromStdlibByShortName.kt")
|
||||
public void testTopLevelClassFromStdlibByShortName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib/TopLevelClassFromStdlibByShortName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelFunctionFromStdlibByFullName.kt")
|
||||
public void testTopLevelFunctionFromStdlibByFullName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib/TopLevelFunctionFromStdlibByFullName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("TopLevelFunctionFromStdlibByShortName.kt")
|
||||
public void testTopLevelFunctionFromStdlibByShortName() throws Exception {
|
||||
runTest("analysis/analysis-api/testData/referenceResolve/kDoc/qualified/stdlib/TopLevelFunctionFromStdlibByShortName.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("analysis/analysis-api/testData/referenceResolve/nestedTypes")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+2
@@ -20,6 +20,7 @@ import org.jetbrains.kotlin.analysis.test.framework.project.structure.TestModule
|
||||
import org.jetbrains.kotlin.analysis.test.framework.services.libraries.compiledLibraryProvider
|
||||
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfigurator
|
||||
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestServiceRegistrar
|
||||
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendKind
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
|
||||
import org.jetbrains.kotlin.test.model.TestModule
|
||||
@@ -28,6 +29,7 @@ import org.jetbrains.kotlin.test.services.TestServices
|
||||
|
||||
object AnalysisApiFirLibraryBinaryTestConfigurator : AnalysisApiTestConfigurator() {
|
||||
override val analyseInDependentSession: Boolean get() = false
|
||||
override val frontendKind: FrontendKind get() = FrontendKind.Fir
|
||||
|
||||
override fun configureTest(
|
||||
builder: TestConfigurationBuilder,
|
||||
|
||||
+2
@@ -23,6 +23,7 @@ import org.jetbrains.kotlin.analysis.test.framework.services.libraries.CompiledL
|
||||
import org.jetbrains.kotlin.analysis.test.framework.services.libraries.compiledLibraryProvider
|
||||
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfigurator
|
||||
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestServiceRegistrar
|
||||
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendKind
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
|
||||
import org.jetbrains.kotlin.test.model.TestModule
|
||||
@@ -32,6 +33,7 @@ import org.jetbrains.kotlin.test.services.TestServices
|
||||
|
||||
object AnalysisApiFirLibrarySourceTestConfigurator : AnalysisApiTestConfigurator() {
|
||||
override val analyseInDependentSession: Boolean get() = false
|
||||
override val frontendKind: FrontendKind get() = FrontendKind.Fir
|
||||
|
||||
override fun configureTest(
|
||||
builder: TestConfigurationBuilder,
|
||||
|
||||
Reference in New Issue
Block a user