FIR IDE: generate diagnostics
This commit is contained in:
+6
@@ -995,6 +995,12 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
|||||||
token,
|
token,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
add(FirErrors.CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT) { firDiagnostic ->
|
||||||
|
ConstValNotTopLevelOrObjectImpl(
|
||||||
|
firDiagnostic as FirPsiDiagnostic<*>,
|
||||||
|
token,
|
||||||
|
)
|
||||||
|
}
|
||||||
add(FirErrors.EXPECTED_DECLARATION_WITH_BODY) { firDiagnostic ->
|
add(FirErrors.EXPECTED_DECLARATION_WITH_BODY) { firDiagnostic ->
|
||||||
ExpectedDeclarationWithBodyImpl(
|
ExpectedDeclarationWithBodyImpl(
|
||||||
firDiagnostic as FirPsiDiagnostic<*>,
|
firDiagnostic as FirPsiDiagnostic<*>,
|
||||||
|
|||||||
+4
@@ -701,6 +701,10 @@ sealed class KtFirDiagnostic<PSI: PsiElement> : KtDiagnosticWithPsi<PSI> {
|
|||||||
override val diagnosticClass get() = ValWithSetter::class
|
override val diagnosticClass get() = ValWithSetter::class
|
||||||
}
|
}
|
||||||
|
|
||||||
|
abstract class ConstValNotTopLevelOrObject : KtFirDiagnostic<KtProperty>() {
|
||||||
|
override val diagnosticClass get() = ConstValNotTopLevelOrObject::class
|
||||||
|
}
|
||||||
|
|
||||||
abstract class ExpectedDeclarationWithBody : KtFirDiagnostic<KtDeclaration>() {
|
abstract class ExpectedDeclarationWithBody : KtFirDiagnostic<KtDeclaration>() {
|
||||||
override val diagnosticClass get() = ExpectedDeclarationWithBody::class
|
override val diagnosticClass get() = ExpectedDeclarationWithBody::class
|
||||||
}
|
}
|
||||||
|
|||||||
+7
@@ -1134,6 +1134,13 @@ internal class ValWithSetterImpl(
|
|||||||
override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic)
|
override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal class ConstValNotTopLevelOrObjectImpl(
|
||||||
|
firDiagnostic: FirPsiDiagnostic<*>,
|
||||||
|
override val token: ValidityToken,
|
||||||
|
) : KtFirDiagnostic.ConstValNotTopLevelOrObject(), KtAbstractFirDiagnostic<KtProperty> {
|
||||||
|
override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic)
|
||||||
|
}
|
||||||
|
|
||||||
internal class ExpectedDeclarationWithBodyImpl(
|
internal class ExpectedDeclarationWithBodyImpl(
|
||||||
firDiagnostic: FirPsiDiagnostic<*>,
|
firDiagnostic: FirPsiDiagnostic<*>,
|
||||||
override val token: ValidityToken,
|
override val token: ValidityToken,
|
||||||
|
|||||||
Reference in New Issue
Block a user