[FIR] reference shortener should not touch fake sources

e.g. implicit types can't be shortened.
On the other hand, requesting textRange means building ast
which might be slow, especially for compiled code
This commit is contained in:
Anna Kozlova
2023-03-03 14:11:16 +01:00
committed by Space Team
parent 4b6975c3d0
commit 22b0a8d9fb
@@ -368,7 +368,7 @@ private class ElementsToShortenCollector(
}
private fun processTypeRef(resolvedTypeRef: FirResolvedTypeRef) {
val wholeTypeReference = resolvedTypeRef.psi as? KtTypeReference ?: return
val wholeTypeReference = resolvedTypeRef.realPsi as? KtTypeReference ?: return
if (!wholeTypeReference.textRange.intersects(selection)) return
val wholeClassifierId = resolvedTypeRef.type.lowerBoundIfFlexible().candidateClassId ?: return