[FIR IDE] Fixed getting symbols for lambda literal
This commit is contained in:
+5
@@ -27,6 +27,11 @@ abstract class KtSymbolProvider : KtAnalysisSessionComponent() {
|
||||
literalExpression?.let(::getAnonymousObjectSymbol) ?: getClassOrObjectSymbol(psi)
|
||||
}
|
||||
is KtPropertyAccessor -> getPropertyAccessorSymbol(psi)
|
||||
is KtFunctionLiteral -> {
|
||||
val literalExpression = psi.parent as? KtLambdaExpression
|
||||
check(literalExpression != null) { "Unexpected parent for KtFunctionLiteral" }
|
||||
getAnonymousFunctionSymbol(literalExpression)
|
||||
}
|
||||
else -> error("Cannot build symbol for ${psi::class}")
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -127,6 +127,7 @@ internal class FirModuleResolveStateImpl(
|
||||
val firDeclaration = FirElementFinder.findElementIn<FirDeclaration>(container) { firDeclaration ->
|
||||
when (val realPsi = firDeclaration.realPsi) {
|
||||
is KtObjectLiteralExpression -> realPsi.objectDeclaration == ktDeclaration
|
||||
is KtFunctionLiteral -> realPsi.parent == ktDeclaration
|
||||
else -> realPsi == ktDeclaration
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user