From e41a79fbe9311a39bab777f51320bb57795af355 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Thu, 25 Apr 2019 14:04:34 +0300 Subject: [PATCH] Unify building references to symbols in html fir dump --- .../src/org/jetbrains/kotlin/fir/dump/HtmlFirDump.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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 c22843449e9..647e062ffaa 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 @@ -610,9 +610,7 @@ class HtmlFirDump internal constructor(private var linkResolver: FirLinkResolver private fun FlowContent.generate(type: ConeClassType) { resolved { - val link = linkResolver.classLocation(type.lookupTag.classId) - declarationRef(link, setOf("class-fqn")) { - title = type.lookupTag.classId.asString() + symbolRef(type.lookupTag.toSymbol(session)) { fqn(type.lookupTag.classId.relativeClassName) } } @@ -908,8 +906,12 @@ class HtmlFirDump internal constructor(private var linkResolver: FirLinkResolver } private fun FlowContent.symbolRef(symbol: ConeSymbol?, body: FlowContent.() -> Unit) { - val link = if (symbol == null) null else linkResolver.nearSymbolLocation(symbol) - declarationRef(link, setOf("symbol")) { + val (link, classes) = when (symbol) { + null -> null to setOf() + is ConeClassLikeSymbol -> linkResolver.classLocation(symbol.classId) to setOf("class-fqn") + else -> linkResolver.nearSymbolLocation(symbol) to setOf("symbol") + } + declarationRef(link, classes) { if (symbol != null) { title = symbol.describe() }