From 2d57aafef38b1b238ea020d0e85834ef9c25b35c Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Tue, 24 Nov 2015 20:36:41 +0300 Subject: [PATCH] Misc: Render text of lambdas and functional expressions in "Extract..." popups --- .../org/jetbrains/kotlin/idea/refactoring/jetRefactoringUtil.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/jetRefactoringUtil.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/jetRefactoringUtil.kt index 735e91e6e3e..6bf99ddb93f 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/jetRefactoringUtil.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/jetRefactoringUtil.kt @@ -361,6 +361,8 @@ public fun chooseContainerElement( } 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]