Move common diagnostics infrastructure to frontend.common

This commit is contained in:
Ilya Chernikov
2021-09-20 19:21:31 +02:00
parent f1d0ead652
commit e9f59e8d1d
253 changed files with 404 additions and 341 deletions
@@ -17,6 +17,7 @@ import kotlin.reflect.KTypeProjection
object ErrorListDiagnosticListRenderer : DiagnosticListRenderer() {
private const val BASE_PACKAGE = "org.jetbrains.kotlin.fir.analysis.diagnostics"
private const val DIAGNOSTICS_PACKAGE = "org.jetbrains.kotlin.diagnostics"
override fun render(file: File, diagnosticList: DiagnosticList, packageName: String) {
file.writeToFileUsingSmartPrinterIfFileContentChanged {
@@ -121,6 +122,9 @@ object ErrorListDiagnosticListRenderer : DiagnosticListRenderer() {
if (packageName != BASE_PACKAGE) {
add("$BASE_PACKAGE.*")
}
if (packageName != DIAGNOSTICS_PACKAGE) {
add("$DIAGNOSTICS_PACKAGE.*")
}
diagnosticList.allDiagnostics.forEach { diagnostic ->
for (typeArgument in diagnostic.getAllTypeArguments()) {
typeArgument.collectClassNamesTo(this)