[FIR] Render diagnostics parameters instead of full text in debug messages (closer to old tests)

This commit is contained in:
Ivan Kochurkin
2021-05-20 18:28:50 +03:00
committed by TeamCityServer
parent 6de97e17fe
commit ef53f0e0b3
6 changed files with 23 additions and 6 deletions
@@ -31,4 +31,10 @@ public class SimpleDiagnosticRenderer implements DiagnosticRenderer<Diagnostic>
public String render(@NotNull Diagnostic diagnostic) {
return message;
}
@NotNull
@Override
public Object[] renderParameters(@NotNull Diagnostic diagnostic) {
return new Object[0];
}
}
@@ -27,11 +27,11 @@ abstract class AbstractDiagnosticWithParametersRenderer<in D : UnboundDiagnostic
return messageFormat.format(renderParameters(diagnostic))
}
abstract fun renderParameters(diagnostic: D): Array<out Any?>
override fun renderParameters(diagnostic: D): Array<out Any?> {
return arrayOf()
}
}
class DiagnosticWithParameters1Renderer<A>(
message: String,
private val rendererForA: DiagnosticParameterRenderer<A>?
@@ -83,7 +83,7 @@ class DiagnosticWithParameters4Renderer<A : Any, B : Any, C : Any, D : Any>(
private val rendererForD: DiagnosticParameterRenderer<D>?,
) : AbstractDiagnosticWithParametersRenderer<DiagnosticWithParameters4<*, A, B, C, D>>(message) {
override fun renderParameters(diagnostic: DiagnosticWithParameters4<*, A, B, C, D>): Array<out Any> {
override fun renderParameters(diagnostic: DiagnosticWithParameters4<*, A, B, C, D>): Array<out Any?> {
val context = RenderingContext.of(diagnostic.a, diagnostic.b, diagnostic.c, diagnostic.d)
return arrayOf(
renderParameter(diagnostic.a, rendererForA, context),