Misc: Render text of lambdas and functional expressions in "Extract..." popups

This commit is contained in:
Alexey Sedunov
2015-11-24 20:36:41 +03:00
parent 5889971d62
commit 2d57aafef3
@@ -361,6 +361,8 @@ public fun chooseContainerElement<T>(
}
private fun PsiElement.renderDeclaration(): String? {
if (this is KtFunctionLiteral || isFunctionalExpression()) return renderText()
val descriptor = when {
this is KtFile -> getName()
this is KtElement -> analyze()[BindingContext.DECLARATION_TO_DESCRIPTOR, this]