[FIR JS] Implement FirJsRuntimeAnnotationChecker
This commit is contained in:
committed by
Space Team
parent
56285bb2d6
commit
7b8f5f9980
+12
@@ -1007,6 +1007,18 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirJsErrors.RUNTIME_ANNOTATION_NOT_SUPPORTED) { firDiagnostic ->
|
||||
RuntimeAnnotationNotSupportedImpl(
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirJsErrors.RUNTIME_ANNOTATION_ON_EXTERNAL_DECLARATION) { firDiagnostic ->
|
||||
RuntimeAnnotationOnExternalDeclarationImpl(
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.OPT_IN_USAGE) { firDiagnostic ->
|
||||
OptInUsageImpl(
|
||||
firDiagnostic.a,
|
||||
|
||||
+8
@@ -724,6 +724,14 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
override val diagnosticClass get() = NestedJsModuleProhibited::class
|
||||
}
|
||||
|
||||
abstract class RuntimeAnnotationNotSupported : KtFirDiagnostic<PsiElement>() {
|
||||
override val diagnosticClass get() = RuntimeAnnotationNotSupported::class
|
||||
}
|
||||
|
||||
abstract class RuntimeAnnotationOnExternalDeclaration : KtFirDiagnostic<PsiElement>() {
|
||||
override val diagnosticClass get() = RuntimeAnnotationOnExternalDeclaration::class
|
||||
}
|
||||
|
||||
abstract class OptInUsage : KtFirDiagnostic<PsiElement>() {
|
||||
override val diagnosticClass get() = OptInUsage::class
|
||||
abstract val optInMarkerFqName: FqName
|
||||
|
||||
+10
@@ -870,6 +870,16 @@ internal class NestedJsModuleProhibitedImpl(
|
||||
override val token: KtLifetimeToken,
|
||||
) : KtFirDiagnostic.NestedJsModuleProhibited(), KtAbstractFirDiagnostic<KtElement>
|
||||
|
||||
internal class RuntimeAnnotationNotSupportedImpl(
|
||||
override val firDiagnostic: KtPsiDiagnostic,
|
||||
override val token: KtLifetimeToken,
|
||||
) : KtFirDiagnostic.RuntimeAnnotationNotSupported(), KtAbstractFirDiagnostic<PsiElement>
|
||||
|
||||
internal class RuntimeAnnotationOnExternalDeclarationImpl(
|
||||
override val firDiagnostic: KtPsiDiagnostic,
|
||||
override val token: KtLifetimeToken,
|
||||
) : KtFirDiagnostic.RuntimeAnnotationOnExternalDeclaration(), KtAbstractFirDiagnostic<PsiElement>
|
||||
|
||||
internal class OptInUsageImpl(
|
||||
override val optInMarkerFqName: FqName,
|
||||
override val message: String,
|
||||
|
||||
Reference in New Issue
Block a user