[Analysis API FIR] KtFirPsiTypeProvider: drop redundant TODO

Regular type annotations work as expected

^KT-62351 Obsolete
This commit is contained in:
Dmitrii Gridin
2024-03-12 17:17:16 +01:00
committed by Space Team
parent ba421aa320
commit 5689dedea0
8 changed files with 62 additions and 2 deletions
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. * Copyright 2010-2024 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. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/ */
@@ -138,7 +138,7 @@ internal class KtFirPsiTypeProvider(
val javaType = JavaTypeImpl.create(psiType, javaElementSourceFactory.createTypeSource(psiType)) val javaType = JavaTypeImpl.create(psiType, javaElementSourceFactory.createTypeSource(psiType))
val javaTypeRef = buildJavaTypeRef { val javaTypeRef = buildJavaTypeRef {
//TODO KT-62351 // Annotations are unused during `resolveIfJavaType`, so there is no need to provide something
annotationBuilder = { emptyList() } annotationBuilder = { emptyList() }
type = javaType type = javaType
} }
@@ -99,6 +99,18 @@ public class FirIdeDependentAnalysisSourceModuleAnalysisApiKtTypeByPsiTypeProvid
runTest("analysis/analysis-api/testData/components/psiTypeProvider/psiType/asKtType/primitive.kt"); runTest("analysis/analysis-api/testData/components/psiTypeProvider/psiType/asKtType/primitive.kt");
} }
@Test
@TestMetadata("typeAnnotation.kt")
public void testTypeAnnotation() {
runTest("analysis/analysis-api/testData/components/psiTypeProvider/psiType/asKtType/typeAnnotation.kt");
}
@Test
@TestMetadata("typeAnnotationOnString.kt")
public void testTypeAnnotationOnString() {
runTest("analysis/analysis-api/testData/components/psiTypeProvider/psiType/asKtType/typeAnnotationOnString.kt");
}
@Test @Test
@TestMetadata("typeParameterWithKotlinUseSite.kt") @TestMetadata("typeParameterWithKotlinUseSite.kt")
public void testTypeParameterWithKotlinUseSite() { public void testTypeParameterWithKotlinUseSite() {
@@ -99,6 +99,18 @@ public class FirIdeNormalAnalysisSourceModuleAnalysisApiKtTypeByPsiTypeProviderT
runTest("analysis/analysis-api/testData/components/psiTypeProvider/psiType/asKtType/primitive.kt"); runTest("analysis/analysis-api/testData/components/psiTypeProvider/psiType/asKtType/primitive.kt");
} }
@Test
@TestMetadata("typeAnnotation.kt")
public void testTypeAnnotation() {
runTest("analysis/analysis-api/testData/components/psiTypeProvider/psiType/asKtType/typeAnnotation.kt");
}
@Test
@TestMetadata("typeAnnotationOnString.kt")
public void testTypeAnnotationOnString() {
runTest("analysis/analysis-api/testData/components/psiTypeProvider/psiType/asKtType/typeAnnotationOnString.kt");
}
@Test @Test
@TestMetadata("typeParameterWithKotlinUseSite.kt") @TestMetadata("typeParameterWithKotlinUseSite.kt")
public void testTypeParameterWithKotlinUseSite() { public void testTypeParameterWithKotlinUseSite() {
@@ -99,6 +99,18 @@ public class FirStandaloneNormalAnalysisSourceModuleAnalysisApiKtTypeByPsiTypePr
runTest("analysis/analysis-api/testData/components/psiTypeProvider/psiType/asKtType/primitive.kt"); runTest("analysis/analysis-api/testData/components/psiTypeProvider/psiType/asKtType/primitive.kt");
} }
@Test
@TestMetadata("typeAnnotation.kt")
public void testTypeAnnotation() {
runTest("analysis/analysis-api/testData/components/psiTypeProvider/psiType/asKtType/typeAnnotation.kt");
}
@Test
@TestMetadata("typeAnnotationOnString.kt")
public void testTypeAnnotationOnString() {
runTest("analysis/analysis-api/testData/components/psiTypeProvider/psiType/asKtType/typeAnnotationOnString.kt");
}
@Test @Test
@TestMetadata("typeParameterWithKotlinUseSite.kt") @TestMetadata("typeParameterWithKotlinUseSite.kt")
public void testTypeParameterWithKotlinUseSite() { public void testTypeParameterWithKotlinUseSite() {
@@ -0,0 +1,10 @@
// FILE: KotlinClass.kt
@Target(AnnotationTarget.TYPE)
annotation class MyAnno
class Kotlin<caret_useSite>Class
// FILE: A.java
public interface A {
@MyAnno KotlinClass f<caret>oo();
}
@@ -0,0 +1,2 @@
PsiType: PsiType:KotlinClass
KtType: @MyAnno KotlinClass?
@@ -0,0 +1,10 @@
// FILE: KotlinClass.kt
@Target(AnnotationTarget.TYPE)
annotation class MyAnno
class Kotlin<caret_useSite>Class
// FILE: A.java
public interface A {
@MyAnno String f<caret>oo();
}
@@ -0,0 +1,2 @@
PsiType: PsiType:String
KtType: @MyAnno kotlin.String?