[FIR] Improve type-parameter rendering in html dump

This commit is contained in:
simon.ogorodnik
2020-03-31 21:45:44 +03:00
parent cb00a4c136
commit 49d361b6eb
@@ -33,6 +33,7 @@ import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirTypeAliasSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirTypeAliasSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol
import org.jetbrains.kotlin.fir.types.* import org.jetbrains.kotlin.fir.types.*
import org.jetbrains.kotlin.fir.types.impl.FirTypePlaceholderProjection import org.jetbrains.kotlin.fir.types.impl.FirTypePlaceholderProjection
import org.jetbrains.kotlin.fir.visitors.FirVisitorVoid import org.jetbrains.kotlin.fir.visitors.FirVisitorVoid
@@ -637,6 +638,7 @@ class HtmlFirDump internal constructor(private var linkResolver: FirLinkResolver
classKind(klass.classKind) classKind(klass.classKind)
ws ws
anchoredName(klass.name, klass.classId.asString()) anchoredName(klass.name, klass.classId.asString())
generateTypeParameters(klass)
if (klass.superTypeRefs.isNotEmpty()) { if (klass.superTypeRefs.isNotEmpty()) {
+": " +": "
generateList(klass.superTypeRefs) { generateList(klass.superTypeRefs) {
@@ -934,7 +936,9 @@ class HtmlFirDump internal constructor(private var linkResolver: FirLinkResolver
keyword("reified ") keyword("reified ")
} }
if (describe) if (describe)
simpleName(typeParameter.name) symbolRef(typeParameter.symbol) {
simpleName(typeParameter.name)
}
else else
symbolAnchor(typeParameter.symbol) { symbolAnchor(typeParameter.symbol) {
simpleName(typeParameter.name) simpleName(typeParameter.name)
@@ -951,7 +955,8 @@ class HtmlFirDump internal constructor(private var linkResolver: FirLinkResolver
generateTypeParameter(it, describe) generateTypeParameter(it, describe)
} else { } else {
symbolRef(it.symbol) { symbolRef(it.symbol) {
generateTypeParameter(it.symbol.fir, describe = true) +"^"
simpleName(it.symbol.fir.name)
} }
} }
} }
@@ -1103,6 +1108,7 @@ class HtmlFirDump internal constructor(private var linkResolver: FirLinkResolver
return when (this) { return when (this) {
is FirClassLikeSymbol<*> -> classId.asString() is FirClassLikeSymbol<*> -> classId.asString()
is FirCallableSymbol<*> -> callableId.toString() is FirCallableSymbol<*> -> callableId.toString()
is FirTypeParameterSymbol -> name.asString()
else -> "" else -> ""
} }
} }