Introduce FirResolvedTypeRef.delegatedTypeRef to see children types in IDE

This is needed to have access to resolved children types (e.g. type arguments) from IDE
This commit is contained in:
Mikhail Glukhikh
2019-07-31 15:46:06 +03:00
parent 38c1a50c1d
commit 8808c775a4
14 changed files with 41 additions and 5 deletions
@@ -20,6 +20,7 @@ import org.jetbrains.kotlin.fir.scopes.impl.selfImportingScope
import org.jetbrains.kotlin.fir.symbols.CallableId
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
import org.jetbrains.kotlin.fir.types.FirErrorTypeRef
import org.jetbrains.kotlin.fir.types.FirUserTypeRef
import org.jetbrains.kotlin.fir.visitors.FirVisitorVoid
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.FqName
@@ -190,6 +191,10 @@ fun KtElement.getOrBuildFir(
override fun visitThisReference(thisReference: FirThisReference) {}
override fun visitErrorTypeRef(errorTypeRef: FirErrorTypeRef) {}
override fun visitUserTypeRef(userTypeRef: FirUserTypeRef) {
userTypeRef.acceptChildren(this)
}
})
var current: PsiElement? = psi
while (current is KtElement) {