From 42a48ef31281d0a2a4cf4f04904f728ef9f8734c Mon Sep 17 00:00:00 2001 From: "simon.ogorodnik" Date: Tue, 31 Mar 2020 21:46:20 +0300 Subject: [PATCH] [FIR] Improve constraint errors rendering in html dump --- .../org/jetbrains/kotlin/fir/dump/colors.dark.css | 4 ++++ .../org/jetbrains/kotlin/fir/dump/colors.white.css | 4 ++++ .../src/org/jetbrains/kotlin/fir/dump/HtmlFirDump.kt | 9 +++++---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/compiler/fir/dump/resources/org/jetbrains/kotlin/fir/dump/colors.dark.css b/compiler/fir/dump/resources/org/jetbrains/kotlin/fir/dump/colors.dark.css index db74f64bf31..efff8347bfe 100644 --- a/compiler/fir/dump/resources/org/jetbrains/kotlin/fir/dump/colors.dark.css +++ b/compiler/fir/dump/resources/org/jetbrains/kotlin/fir/dump/colors.dark.css @@ -43,6 +43,10 @@ body.dark { text-decoration-color: red; } +.dark .subtype-error { + color: red; +} + .dark .error.unsupported { text-decoration-color: cyan; } diff --git a/compiler/fir/dump/resources/org/jetbrains/kotlin/fir/dump/colors.white.css b/compiler/fir/dump/resources/org/jetbrains/kotlin/fir/dump/colors.white.css index 9ada48c3476..026357d18f2 100644 --- a/compiler/fir/dump/resources/org/jetbrains/kotlin/fir/dump/colors.white.css +++ b/compiler/fir/dump/resources/org/jetbrains/kotlin/fir/dump/colors.white.css @@ -37,6 +37,10 @@ text-decoration-color: red; } +.white .subtype-error { + color: red; +} + .white .error.unsupported { text-decoration-color: cyan; } diff --git a/compiler/fir/dump/src/org/jetbrains/kotlin/fir/dump/HtmlFirDump.kt b/compiler/fir/dump/src/org/jetbrains/kotlin/fir/dump/HtmlFirDump.kt index 3daf190adc5..4ad406419b2 100644 --- a/compiler/fir/dump/src/org/jetbrains/kotlin/fir/dump/HtmlFirDump.kt +++ b/compiler/fir/dump/src/org/jetbrains/kotlin/fir/dump/HtmlFirDump.kt @@ -1221,11 +1221,12 @@ class HtmlFirDump internal constructor(private var linkResolver: FirLinkResolver when (callDiagnostic) { is NewConstraintError -> { ident() - +"Lower: " + generate(callDiagnostic.lowerType as ConeKotlinType) - br - ident() - +"Upper: " + + ws + span(classes = "subtype-error") { +"<:" } + ws generate(callDiagnostic.upperType as ConeKotlinType) } else -> {